Fix dark HUD icons when using light system theme
Summary:
The HUD widgets are custom and always dark themed. When using a light
system theme like Breeze, the icons were rendered with a dark color,
which was bad because it didn't contrast with the dark HUD. This was
not an issue in full screen mode, because we force the whole of
Gwenview to use a dark theme, and therefore the icons rendered a light
color.
This affects:
- Compare / Light table mode
- Video controls popup
- The "You are now viewing the new document" message after Save As
(Other places the HUD is used do not use icons)
So, when setting an icon using HudButton::setIcon, this patch now
re-loads the icon using the KIconLoader global instance, setting a
custom palette with a white foreground color, so the loader loads a
light icon. KIconLoader's palette is then reset as to not interfere
with other icons.
BUG: 380257
FIXED-IN: 18.08.0
Note: we bump KF5 version to 5.39 for KIconLoader::setCustomPalette
and KIconLoader::resetPalette.
Compare/Lighttable Before:
Compare/Lighttable After:
Video Controls Before:
Video Controls After:
Save As message Before:
Save As message After:
Test Plan:
The following have HUD widgets with icons:
- Compare / Light table mode
- Video controls popup
- The "You are now viewing the new document" message after Save As
Note for 3), the HUD only appears for a split second, due to a bug. See
D9342.
Reviewers: Gwenview, rkflx
Reviewed By: Gwenview, rkflx
Subscribers: muhlenpfordt
Tags: Gwenview
Differential Revision: https://phabricator.kde.org/D12595