icons: Fix icon theme support for StatusNotifierItem
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 11 Jun 2018 19:07:37 +0000 (21:07 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 15 Jun 2018 23:30:32 +0000 (01:30 +0200)
commit9f0918fca1d858523104435690e5094bfe6244b7
treebb2357eae8cc6bbcd5585271a430b5178f4a5397
parent74bbd92b31eac0b308b252694f48a37e4f349f50
icons: Fix icon theme support for StatusNotifierItem

If SNI is used, the tray icons are passed along to the visualizer
by name rather than as a pixmap (the SNI protocol would support
pixmaps too, however that is a) discouraged and b) not supported
e.g. in Unity).

The SNI interface supports a more or less undocumented attribute
IconThemePath, which may contain an additional path for the
visualizer to look into for specific icons. At least Plasma and
LXQt seem to expect a hicolor theme in the given directory.

Have StatusNotifierItem create a skeleton hicolor theme containing
the tray icons in a temporary directory, and pass that along via
IconThemePath. The tray icons to be saved are dynamically determined
using the current icon theme/fallback.

All available icon sizes are saved as pixmaps; sadly, with the dynamic
approach, scalable icons cannot be supported. Alternatively, one could
hard-code the relevant .svg files from the fallback themes, and copy
those, but that would just be annoying - and kill themeability.
src/qtui/qtui.cpp
src/qtui/qtui.h
src/qtui/statusnotifieritem.cpp
src/qtui/statusnotifieritem.h