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

Elvis Stansvik elvstone at gmail.com
Sun Jun 25 10:16:33 CEST 2017


2017-06-25 10:04 GMT+02:00 Elvis Stansvik <elvstone at gmail.com>:
> 2017-06-21 11:18 GMT+02:00 René J.V. Bertin <rjvbertin at gmail.com>:
>> Hi,
>>
>> I'd like to create a single binary .rcc resource from a total of 4 Freedesktop icon themes that are linked through inheritance.
>> Merging the actual directories is straightforward, but creating a merged index.theme file isn't .
>>
>> Does anyone know of a tool to assist in that part of the merge or is there rcc functionality I'm overlooking that allows a .rcc file to declare a dependency on another .rcc file, such that the application needs only register that single "toplevel" rcc file?
>
> Even after reading your other mails, I'm not 100% sure I understand
> what you want to do.
>
> Say you have
>
>     icontheme1/actions/16/some_action.svg
>     icontheme1/...
>     icontheme1/index.theme
>
>     icontheme2/actions/16/some_action.svg
>     icontheme2/...
>     icontheme2/index.theme
>
>     icontheme3/actions/16/some_action.svg
>     icontheme3/...
>     icontheme3/index.theme
>
>     icontheme4/actions/16/some_action.svg
>     icontheme4/...
>     icontheme4/index.theme
>
> perhaps with inheritances icontheme4 -> icontheme3 -> icontheme2 -> icontheme1.
>
> 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>
>
>     <file>icontheme2/actions/16/some_action.svg</file>
>     <file>icontheme2/...</file>
>     <file>icontheme2/index.theme</file>
>
>     <file>icontheme3/actions/16/some_action.svg</file>
>     <file>icontheme3/...</file>
>     <file>icontheme3/index.theme</file>
>
>     <file>icontheme4/actions/16/some_action.svg</file>
>     <file>icontheme4/...</file>
>     <file>icontheme4/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'm most probably missing some aspect here, but if you now correct me,
> it will hopefully help us understand :)

I should also mention, I'm doing something slightly similar in my app.

I have

myapp.qrc:

<RCC>
    <qresource prefix="/">
        <file>icons/hicolor/scalable/apps/some_application_specific_icon.svg</file>
        <file>icons/hicolor/scalable/apps/another_application_specific_icon.svg</file>
        ...
    </qresource>
</RCC>

but also

breeze.qrc:

<RCC>
  <qresource prefix="/icons">
    <file>breeze/actions/24/application-exit.svg</file>
    <file>breeze/actions/32/application-exit.svg</file>
    ...
  </qresource>
</RCC>

and on macOS/Windows, I process both these with rcc and link both into
my application, and do QIcon::setThemeName("breeze"). The "breeze"
theme inherits "hicolor", so my application-specific icons will be
found.

(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.)

Elvis

>
> Elvis
>
>>
>> Thanks,
>> René
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list