-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WarningThemedResource and SuccessThemedResource #4040
Comments
You can use |
Yes, but there is already NewErrorThemeResource, NewDisableThemeResource, NewPrimaryThemeResource, why not Warning and Success ? |
The reason is because ColorName was added more recently, so you can achieve what you want. Perhaps the others should be added, but I thought that info may help. |
If we already have an API to achieve this for all colours, then I think we should stick with that and perhaps deprecate the other APIs for specific colours. Adding one for each colour is going to result in adding a lot of them |
That is what I was thinking. But then I realised we have them for accessing the colour itself in the theme API. I do wonder if we should move to fewer and perhaps |
I don't know the best solution, but as the user point of view, my code looks ugly with mixed NewErrorThemedResource and NewthemedResource + ColorName = ColorSuccessName. I expect something more streamlined. |
Yeah, that seems like a good idea. |
Don't add new types though, this is getting simplified in future releases. Fixes fyne-io#4040
Opened PR to get these into 2.4.0 for parity. |
Closing as the essentials are delivered - ongoing discussion of API complexity is in #4141 |
Checklist
Is your feature request related to a problem?
I wanted to use colored icons for my app. I used the ones available like NewPrimaryThemedResource(), NewErrorThemedResource() and NewDisabledResource().
But I also want to use warning and success color.
Is it possible to construct a solution with the existing API?
I modified theme/icons.go and it worked as expected. Here is the code :
Describe the solution you'd like to see.
Adding themed warning and success allow to create green and orange icons.
this code will work
The text was updated successfully, but these errors were encountered: