Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selectable and toggleable Icon(Action)Button #501

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

rock3r
Copy link
Collaborator

@rock3r rock3r commented Jul 29, 2024

Introduces two variants for IconButton and IconActionButton:

  • SelectableIcon(Action)Button
  • ToggleableIcon(Action)Button

What they do should be self-evident.

Other changes include adding the ability to provide PainterHints to IconActionButtons, adding a standalone demo for the new icon buttons, separating and cleaning out states and styling helpers.

Important

This PR makes ToggleableComponentState not extend SelectableComponentState anymore. It should never have been extending it to begin with, but we did it to save some time in the past. Semantically, it is not correct, so this PR undoes that change and updates the Checkbox accordingly.


Note: the main difference between an IconButton and its equivalent IconActionButton is that the latter is built upon the former, and handles automatically:

  • Tooltips (if defined)
  • Stroke modifiers (for selectable and toggleable)
  • Icon loading

Introduces two variants for `IconButton` and `IconActionButton`:
* `SelectableIcon(Action)Button`
* `ToggleableIcon(Action)Button`

What they do should be self-evident.

Other changes include adding the ability to provide `PainterHint`s to
`IconActionButton`s, adding a standalone demo for the new icon buttons,
separating and cleaning out states and styling helpers.

Note: the main difference between an `IconButton` and its equivalent
`IconActionButton` is that the latter is built upon the former, and
handles automatically:
 * Tooltips (if defined)
 * Stroke modifiers (for selectable and toggleable)
 * Icon loading
@rock3r rock3r added new component A new component to implement cleanup Improve the project/tooling and/or get rid of tech debt labels Jul 29, 2024
@rock3r rock3r requested review from hamen and devkanro July 29, 2024 11:15
@rock3r rock3r self-assigned this Jul 29, 2024
@rock3r rock3r enabled auto-merge (squash) July 29, 2024 11:15
@rock3r rock3r merged commit dae048c into main Jul 30, 2024
4 checks passed
@rock3r rock3r deleted the more-icon-buttons branch July 30, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Improve the project/tooling and/or get rid of tech debt new component A new component to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants