Skip to content

refactor: use custom component for tool buttons to allow grouping - #600

Merged
robertwidfen merged 4 commits into
Satty-org:mainfrom
RobertMueller2:tool_groups
Aug 10, 2026
Merged

refactor: use custom component for tool buttons to allow grouping#600
robertwidfen merged 4 commits into
Satty-org:mainfrom
RobertMueller2:tool_groups

Conversation

@RobertMueller2

@RobertMueller2 RobertMueller2 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Closes: #538
prereq for #469

This allows grouping tools under one button. e.g. arrow and line, rectangle and circle. Right-click opens popover.

Used FactoryComponent along with FactoryVecDeque because that simplified reference storage on the toolbar. Controllers can't be cloned, that made a regular component quite tricky here, i've tried for quite a while to use a regular Component, this would likely have required more explicit lifetimes.

The downside of this is, ungrouped tools also have to use the new component. I can't exclude for 100% that a mixed use was possible, but the code would have been messier that way.

  • Would like to figure out to show both icon and label on the popover menuitems, but too tired now
  • Perhaps the new component can still be optimised a tad for the single tool case

I'm not implementing any variants here, that can be done later and needs new issues per variant. There will be some with pixelate, though.

Video slightly outdated, the popver buttons now show both icon and label.

tool_groups.mp4

@RobertMueller2 RobertMueller2 changed the title refactor: use custom components for tool buttons to allow grouping refactor: use custom component for tool buttons to allow grouping Aug 3, 2026
@RobertMueller2
RobertMueller2 force-pushed the tool_groups branch 2 times, most recently from 2f5c11a to f0f79af Compare August 4, 2026 06:53
Closes: Satty-org#538

prereq for Satty-org#469

builds on Satty-org#555 because it makes no sense otherwise.

This allows grouping tools under one button.
E.g. arrow and line, rectangle and circle

Used FactoryComponent along with FactoryVecDeque because that simplified
reference storage on the toolbar.
@robertwidfen

Copy link
Copy Markdown
Collaborator

LGTM

@robertwidfen
robertwidfen merged commit 39edcba into Satty-org:main Aug 10, 2026
3 checks passed
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.

feature: Tool secondary, tertiary modes

2 participants