Skip to content

Update child widget on button action changes - #1286

Merged
thoellt merged 2 commits into
masterfrom
feature/tool-button-action-change
Jul 28, 2026
Merged

Update child widget on button action changes#1286
thoellt merged 2 commits into
masterfrom
feature/tool-button-action-change

Conversation

@thoellt

@thoellt thoellt commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

In the current core, a WidgetActionToolButton that is re-pointed at a different action keeps showing the action it was first opened with. Changing the action is ignored, for the lifetime of the button.

This appeared when using PluginTriggerPickerAction in the FcsLoader to provide transformation plugins in the loader (e.g., do a log transform after loading in a single (user facing) step). PluginTriggerPickerAction for transformations uses a WidgetActionToolButton to provide access to transformation plugins' settings. If multiple transformation plugins with different settings are present, only the first shown settings widget would be shown.

This is fixed by connecting the already existing actionChanged signal to delete the child widget. (ll. 79-85)

The fix surfaced a second issue; the size of the widget would only be set once on start, so deleting the child and adding a bigger one would squish the ui (I already noticed similar behavior when modifying visible UI in these widgets, instead of disabling, I did not pursue this, but this might also fix, or be useful for that case).

This behavior is fixed by return sizeHint from popups if available and notifying menu on init. (rest of changes)

Example of correct widgets for two different transformations (centering and derivative) exposed through the PluginTriggerPickerAction.

Screenshot 2026-07-28 at 13 02 28 Screenshot 2026-07-28 at 13 02 54

When first opening the panel for the centering transform then switching to derivative and opening the panel (note the panel must be opened in both steps, due to its lazy loading behavior). The panel does not update and derivate transform shows the centering panel.

Screenshot 2026-07-28 at 13 02 37

@thoellt thoellt added the bug Something isn't working label Jul 28, 2026
@thoellt
thoellt requested a review from ThomasKroes July 28, 2026 12:50
@thoellt
thoellt marked this pull request as ready for review July 28, 2026 13:29
@thoellt
thoellt merged commit ccad632 into master Jul 28, 2026
8 checks passed
@thoellt
thoellt deleted the feature/tool-button-action-change branch July 28, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants