Skip to content

Extend Alt+drag rubberband to all container widgets#3758

Merged
kasemir merged 1 commit intoControlSystemStudio:masterfrom
emilioheredia-source:fix_editor_rubberband_all_containers
Mar 31, 2026
Merged

Extend Alt+drag rubberband to all container widgets#3758
kasemir merged 1 commit intoControlSystemStudio:masterfrom
emilioheredia-source:fix_editor_rubberband_all_containers

Conversation

@emilioheredia-source
Copy link
Copy Markdown

Previously, Alt+left-click-drag to start a rubberband selection inside a container only worked for GroupWidget and TabsWidget (hard-coded instanceof checks). Any other container (e.g. ArrayWidget) would still consume the click and select itself instead.

Replace the specific instanceof checks with ChildrenProperty.getChildren() != null, which returns non-null for any widget that has a children property. This covers GroupWidget, TabsWidget, ArrayWidget, and any future container types automatically.

Previously, Alt+left-click-drag to start a rubberband selection inside
a container only worked for GroupWidget and TabsWidget (hard-coded
instanceof checks). Any other container (e.g. ArrayWidget) would still
consume the click and select itself instead.

Replace the specific instanceof checks with ChildrenProperty.getChildren()
!= null, which returns non-null for any widget that has a children
property. This covers GroupWidget, TabsWidget, ArrayWidget, and any
future container types automatically.
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@kasemir kasemir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks!

@emilioheredia-source
Copy link
Copy Markdown
Author

Hi, this is not a bug per se, but a potential improvement to the code, so new container widgets will inherited by default the ALT+drag to select controls in a region behavior.
Note: I just noticed this because I didn't realize the ALT+drag option existed and was looking at the code when I found it, and noticed this.
Almost trivial, in short, but why not?
Cheers.

@kasemir kasemir merged commit 8b82a16 into ControlSystemStudio:master Mar 31, 2026
3 of 4 checks passed
@emilioheredia-source emilioheredia-source deleted the fix_editor_rubberband_all_containers branch March 31, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants