-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix icon color in dark mode #7917
Conversation
Thanks for your PR, can you please add some Screenshots so we can see your changes? |
This seems very odd, that the icon color could not be changed and would be a major bug in the ikonli package. |
A great tool for debugging javafx guis is https://github.com/JonathanGiles/scenic-view . This should help here too. |
@calixtus Thank you for providing informations, I will improve this a few days later. |
@calixtus @Siedlerchr I modified the icon colors by changing color of each icon in fxml files, not in css file. Then there's a problem that no matter in light mode or in dark mode these icons' color will not changed. So I wonder how can i change these icons in css files. And there's some figures after change, do you have any suggestion? |
I change the color of icon by adding icon-color of the buttons in fxml files. Though it works partly, i think there may a better way to solve this problem. |
I think you can simply override the icon color in the dark.css |
@Siedlerchr I‘ve tested glyph-icon, but it didn't work. I think override the icon color in dark.css may work. But, how to reference these button-icon in css file is kinda hard for me? But i will try. |
According to the documentation of ikonli https://kordamp.org/ikonli/#_javafx you need to change the -fx-icon-color in the css subclass There is also an exception for stacked panes. |
Btw. according to our documentation the base color of icons should always be the same as the text. |
@calixtus Okay, i will follow the documentation to modify the color of icons, thanks. |
Just asking, @Joe11028 Have you made any progress? Are there any things where you struggle? |
@Joe11028 as @calixtus has quoted from the Ikonli documentation, you just need to add this to the end of the Dark.css:
|
@Siedlerchr I add these at the end of base.css and set -fx-icon-color: -fx-text-base-color. Here's the outcome. |
@Siedlerchr I've tried to add this in PreferencesDialog.css instead of Base.css, it looks prettier. I think this one is better. |
Solution to, fixes #7853
After checking dark.css and base.css, and tempting change color of the icons, but find out the color of icons can not be changed, because the icon imported from Package org.kordamp.ikonli.mamaterialdesign is colored and can not be changed. So rather than import another set of icons, I prefer adjusting icon-background-color in dark mode. Then you can find the icon button easily. The effect is shown in the figure.
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)