qtui: Fix icon loading and improve icon theme support
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 4 Jun 2018 22:07:01 +0000 (00:07 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 15 Jun 2018 23:30:32 +0000 (01:30 +0200)
commit3abd4b7d5ab303f8d990c104748e5d5aef4db355
treed71b927ca8bb4c6fddc6732eb6c553c7063715d2
parentca31d8d669faaf6041d270f16b4006972f058f07
qtui: Fix icon loading and improve icon theme support

Quassel relies on quite a number of icons that are part of KDE/Plasma
icon themes such as Breeze and Oxygen, but are not specified by
freedesktop.org's Icon Naming Specification. As such, icon themes
other than the afforementioned most likely don't contain all the
icons Quassel needs.

Additionally, Quassel ships several additional icons that are not part
of any theme, but are made to fit in with Breeze/Oxygen.

In order to ensure that all required icons are available, we now
assume that at least one of Breeze, Breeze Dark or Oxygen themes is
available as a fallback, either as a system-wide installation, or by
having Quassel itself deploy the required subset in its data dir
(related build options will be adapted in a follow-up commit).

Allow the user to configure which fallback theme is to be used,
and if the system icon theme should be completely overridden (as
opposed to just filling in missing icons). If the system theme
is Breeze/Oxygen, just inject the corresponding Quassel-specific
icons. If the configured system theme doesn't match the selected
fallback (and should not be overridden), create a proxy icon theme
that inherits from first the system theme and then the selected
fallback. That way, missing icons are found through the inheritance
chain.

Note that as of Qt 5.11.0, icons from the hicolor default theme are
preferred over the ones from inherited themes, which violates the
Icon Theme Specification (cf. QTBUG-68603). This affects Quassel's
application icon, which will thus always use the Breeze variant
if a non-supported system icon theme is used. Other icons will be
picked from the selected fallback theme, as expected.
src/qtui/qtui.cpp
src/qtui/qtui.h
src/qtui/qtuiapplication.cpp
src/qtui/settingspages/appearancesettingspage.cpp
src/qtui/settingspages/appearancesettingspage.ui