Bernd Eggink wrote:
> Dennis Tomas schrieb:
>> Bernd Eggink wrote:
>>> I'm trying to decorate some AppMenu items with icons. According to the
>>> docs, "Item elements can also have icon attributes, which name an icon
>>> in the current icon theme for the menu item.". However, I never get to
>>> see any.
>>> Can anybody explain what exactly has to be supplied as the icon
>>> attribute value in an element like this?
>>> <Item option="-n" icon="image.png">
>>> An ordinary file path doesn't work. I suspect it has to do with gtk,
>>> but unfortunately I'm not familiar with that stuff.
>> Currently, it only accepts gtk stock ids or icon names (without
>> extension). I've attached a patch that adds support for icon paths
>> relative to appdir.
> Thanks. Works great. I modified it a litte as I prefer absolute paths:
> path = g_build_filename(icon_name, NULL);
> Hope the patch will make it into the next version!
I modified it to allow both relative and absolute paths.
Ideally however, one should be able to specify both an icon name and a
path, so the path is used as a fallback if no themed icon exists.
So one could do this in AppInfo.xml:
<Icon name="icon-name" path="path/to/icon.png"/>
I'll have a try at this today.