Buttons cannot be customized: Can we make them generic over a containing widget?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
As it stands, the current implementation of `widget::Button` cannot be meaningfully customized. Some things that would be nice:
- Containing other visual cues, such as a icon
- Increasing the size for buttons that are meant to be prominent
Proposal:
The current implementation nests a `Label` but aside from `Button::dynamic()` (which we can keep as its a builder method) doesn't do anything label-specific in layout/paint. What if we made `Button` generic over its contained widget?
That would allow us to keep the button-specific logic we know and love (the hovering, rounded edges, click visuals etc) but enable custom contents as well as some control over sizing.
Happy to send a PR if this works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the current widget::Button implementation and its Label containment, including Button::dynamic(). Determine how the proposed generic contained widget would preserve hovering, rounded edges, click visuals, and sizing while allowing custom contents; done means buttons can contain visual cues and support larger prominent layouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100