[Interest] creating a binary .rcc version of a series of Freedesktop icon themes linked through inheritance

René J.V. Bertin rjvbertin at gmail.com
Sun Jun 25 13:25:04 CEST 2017


On Sunday June 25 2017 10:04:09 Elvis Stansvik wrote:

> Say you have
...
> 
> perhaps with inheritances icontheme4 -> icontheme3 -> icontheme2 -> icontheme1.

Yes, something like that, with the last item in the chain being the hicolor theme.

> Then shouldn't you be able to just generate something like:
> 
> iconthemes.rcc:
> 
> <RCC>
>   <qresource prefix="/icons">
>     <file>icontheme1/actions/16/some_action.svg</file>
>     <file>icontheme1/...</file>
>     <file>icontheme1/index.theme</file>
...
>   </qresource>
> </RCC>
> 
> I.e. putting the iconthemes side by side in :/icons in the RCC namespace.
> 
> If the application then QIcon::setThemeName("icontheme4"), I think it
> should just work? Why do you need to merge the index.theme files?

I haven't tried (I suppose I could :)) but you're undoubtedly right given that you seem to have more experience than I do in this domain.

Maybe it will indeed suffice to invoke `rcc --project` in the individual icon theme directories, and then merge the resulting .qrc files more or less as you showed, or even invoke it in the icon themeS directory (if it contains only the themes of interest).
I tried that, but keep getting a runtime error that no index.theme is found (via `QFileInfo::exists(QStringLiteral(":/icons/kf5_rcc_theme/index.theme"))`)

I'll try once more to explain what I'm trying to do:

The main underlying issue is that the combined/merged theme contains a lot of icons. That makes it quite important to be able to use some kind of generator even if you do the rcc creation once only and mostly by hand. The starting point for this whole exploration was on the one hand the automatic binary resource generation in the build system of the Breeze icon theme, and the RCC registration hook I showed from the KIconThemes framework. And the trigger for it all was the fact that I find Breeze utterly inappropriate for use on Mac (many KDE devs are dogmatic about blending in with native look and feel, and IMHO Breeze just doesn't, despite the fact there isn't really an official Mac system icon theme that I know of).

> (Though I realize now that this is actually not a good test case for
> whether the inheritance works, since even if it didn't work, the icon
> engine will fall back to the "hicolor" theme, as mandated by the
> spec.)

True, but it does show that both resources are found.


R.



More information about the Interest mailing list