A question to developers:
I just watched development of coming Blender 2.80 and new icon set: https://blenderartists.org/forum/showth ... ad/page192
If one would like to experiment with the icons is this necessary to recompile FC or the icons could be exchanged as separate resource files?
cheers,
Icon set(s)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Icon set(s)
cheers,
Re: Icon set(s)
FreeCAD supports themes: http://doc.qt.io/archives/qt-4.8/qicon.html#fromTheme
This means that you don't have to replace the icons and rebuild the sources. The steps you have to do are:
In the file src/Gui/Application.cpp you will find these two lines:
This should be changed to
I think we should add some preferences entries so that users don't have to touch the source code to use themes.
As said above you have to make the changes only for macOS or Windows. Linux supports it by default and you have to check the manual how to use another theme.
This means that you don't have to replace the icons and rebuild the sources. The steps you have to do are:
- Create a file index.theme, e.g.:
Code: Select all
[Icon Theme] Name=MyTheme Comment=Default FreeCAD icon theme Inherits=Default # Directory list Directories=scalable [scalable] Size=48 MinSize=8 MaxSize=512 Type=Scalable
- It lists "scalable" as the directory name. So, create the sibling directory to the index.theme file and put your icons underneath. Now you have to look at the FreeCAD source code to determine the icon file names.
In the file src/Gui/Application.cpp you will find these two lines:
Code: Select all
QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << QString::fromLatin1(":/icons/FreeCAD-default"));
QIcon::setThemeName(QLatin1String("FreeCAD-default"));
Code: Select all
QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << QString::fromLatin1("Directory of the index.theme file") << QString::fromLatin1(":/icons/FreeCAD-default"));
QIcon::setThemeName(QLatin1String("MyTheme")); // that's the name defined in the index.theme
As said above you have to make the changes only for macOS or Windows. Linux supports it by default and you have to check the manual how to use another theme.
Re: Icon set(s)
Said and done. git commit d34847fI think we should add some preferences entries so that users don't have to touch the source code to use themes.
Re: Icon set(s)
In addition you can read a discussion we had in the past:
https://forum.freecadweb.org/viewtopic.php?f=10&t=13180
As a result IconThemes module was made:
https://forum.freecadweb.org/viewtopic.php?f=22&t=17901
And a nice icon theme from @pablogil was made:
https://forum.freecadweb.org/viewtopic.php?f=22&t=18417
This should work cross-platform and you can use it now. Next version of IconThemes module will try to tackle the resources files support. And by doing that going beyond the limitations IconThemes module currently has.
https://forum.freecadweb.org/viewtopic.php?f=10&t=13180
As a result IconThemes module was made:
https://forum.freecadweb.org/viewtopic.php?f=22&t=17901
And a nice icon theme from @pablogil was made:
https://forum.freecadweb.org/viewtopic.php?f=22&t=18417
This should work cross-platform and you can use it now. Next version of IconThemes module will try to tackle the resources files support. And by doing that going beyond the limitations IconThemes module currently has.