Ingredients of a typical FreeCAD icon pack (all files located in a single folder):
- Icons preferably in the SVG format (view-top.svg)
- index.theme file
- .qrc file
The contents of an index.theme file:
Code: Select all
[Icon Theme]
Name=Demo
Comment=Demo icon theme pack
Inherits=FreeCAD-default
Directories=scalable
[scalable]
Size=64
Type=Scalable
MinSize=1
MaxSize=256
The contents of a .qrc file:
Code: Select all
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/icons/Demo">
<file>index.theme</file>
</qresource>
<qresource prefix="/icons/Demo/scalable">
<file>view-top.svg</file>
</qresource>
</RCC>
Resource compiler (rcc tool) is used to create an external binary resource data file, for use as a dynamic resource. On Linux:
Code: Select all
/usr/bin/rcc --binary demo.qrc -o demo.rcc
If newer version of rcc tool is used and to preserve support for Qt4 and older Qt5 versions (likely versions below Qt 5.9). Use the --format-version option:
Code: Select all
/usr/bin/rcc --binary demo.qrc -o demo.rcc --format-version 1
P.S. For testing purposes i temporarily modified IconThemes module in a way it will look for Gui/Icons/demo.rcc file inside user application data folder. On Linux that would be ./FreeCAD/Gui/Icons folder (
other platforms). On FreeCAD start, whenever the file is detected, the data will get registered and an icon pack named Demo will get set. Useful for testing the Coil icon pack:
https://forum.freecadweb.org/viewtopic.php?f=34&t=34687
P.S. Feedback on how it works cross platforms is appreciated.