-
Notifications
You must be signed in to change notification settings - Fork 58
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
Two State ToolbarAction Widget #92
Comments
There is a third option (which I guess is what you implemented) to just create an object that has the If the change is conveying some sort of state then it makes sense as an addition, if it is literally just changing the Icon each time tapped then 1. may be more desirable - there is no requirement that the callback from a widget go directly to business logic - the button would often be an inline function that calls out to business logic with appropriate parameters. |
There is the occasional need for a ToolbarAction widget that changes its displayed icon each time the widget is tapped.
Here are two examples where this would be useful:
Those are the two specific use cases that I see for my current app. No doubt there will be others.
Is it possible to construct a solution with the existing APIs?
Not a good one. I see two possible solutions:
There is another potential solution, but that would require adding functionality to ToolbarItems to be hidden, shown, disabled, enabled, and so forth. I assume that this functionality was not provided for a good reason.
I have coded the widget along with a demo program. This is available in the twostate branch at https://github.com/jimorc/fyne-x/tree/twostate. If it is agreed that this widget would be useful, I will add more tests, additional documentation, and then do a PR.
The text was updated successfully, but these errors were encountered: