[Fixed]New light icons for the Navigator Indicator for Dark themes

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: New light icons for the Navigator Indicator for Dark themes

Post by adrianinsaval »

turn211 wrote: Tue Mar 30, 2021 10:40 pm
adrianinsaval wrote: Tue Mar 30, 2021 10:17 pm Could you then add a parameter to override the used icon? I use a system set dark theme (I'm using KDE) so I don't think the icons will be changing for me like this.
If you are using a system wide theme you are not using a stylesheet. You do not have to worry about any of this. :)
I do because it's a dark theme and the default freecad icons don't look good there. So I want to be able to manually set freecad to use the light icons. Ideally freecad would recognize when a dark theme is used and change accordingly but I don't know if that's possible or how reliable it would be.
User avatar
turn211
Posts: 162
Joined: Mon Feb 01, 2021 11:37 pm

Re: New light icons for the Navigator Indicator for Dark themes

Post by turn211 »

adrianinsaval wrote: Tue Mar 30, 2021 10:53 pm
turn211 wrote: Tue Mar 30, 2021 10:40 pm
adrianinsaval wrote: Tue Mar 30, 2021 10:17 pm Could you then add a parameter to override the used icon? I use a system set dark theme (I'm using KDE) so I don't think the icons will be changing for me like this.
If you are using a system wide theme you are not using a stylesheet. You do not have to worry about any of this. :)
I do because it's a dark theme and the default freecad icons don't look good there. So I want to be able to manually set freecad to use the light icons. Ideally freecad would recognize when a dark theme is used and change accordingly but I don't know if that's possible or how reliable it would be.
I know what you want to do but there isn't a switch or setting yet in FreeCAD. That's what stylesheets do, like my Prodark theme. It references the proper icon for the colour etc. There is an Icon changer Mod you could try in Addons. Sorry I can't remember the name.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: New light icons for the Navigator Indicator for Dark themes

Post by adrianinsaval »

I know, that's why I'm asking if he could make one parameter to control that because I don't want to use an stylesheet. I know he might have no interest in doing it but it doesn't hurt to ask ;)
hyarion
Posts: 139
Joined: Fri Jun 26, 2020 6:08 pm

Re: New light icons for the Navigator Indicator for Dark themes

Post by hyarion »

adrianinsaval wrote: Wed Mar 31, 2021 5:04 pm I know, that's why I'm asking if he could make one parameter to control that because I don't want to use an stylesheet. I know he might have no interest in doing it but it doesn't hurt to ask ;)
I've looked into it and I it was a bit too much work for me to jump into at this moment.
I think it would be a great feature request on the bug tracker
hyarion
Posts: 139
Joined: Fri Jun 26, 2020 6:08 pm

Re: New light icons for the Navigator Indicator for Dark themes

Post by hyarion »

turn211 wrote: Tue Mar 30, 2021 10:45 pm
hyarion wrote: Tue Mar 30, 2021 9:20 pm
turn211 wrote: Thu Mar 25, 2021 4:43 pm
hyarion wrote: Thu Mar 25, 2021 7:47 am The usual way of handeling this is to store both icons in the same directory and selecting which version based on type of theme (light vs dark) when loading the icon.

Do you know your way around freecad’s source code or would you like me to look into this for you? (I can do it this weekend)
I only know enough to design so if you could look into it for me that would be great. Thanks.

I've looked into this and I must admit that I was wrong. It is much better to let the stylesheet creator specify this instead as you suggested.
This way it is possible to use a both light and dark versions in the same theme, if needed (for instance you might want to use different colors if the button is highlighted or not).

I've created a pull request here for adding the new files and changed the old once to match the new naming (_light/_dark):
https://github.com/FreeCAD/FreeCAD/pull/4694
Thanks! Very helpful. Great ideas. This now repairs all known Dark theme problems. Now I'll start designing a ProLight Theme. :D
PR is merged now
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: [Fixed]New light icons for the Navigator Indicator for Dark themes

Post by MisterMaker »

Sooooo maybe like 2 years late, but how can we add this too our Stylesheet?
As far as I see it in the code there is nothing added for Stylesheets?
So I probably need to find a way to target it myself like this:

Code: Select all

/*navgation src/Mod/Tux/NavigationIndicatorGui.py */
Gui--NavigationIndicatorGui--BlenderNavigationStyle {
/*QAction#a4 {*/ 
  qproperty-icon: url(:/icons/icons/NavigationBlender_light.svg); 
}
But that doesn't work.
I like the idea, but the implementation is a bit of a bummer :(
Post Reply