Fix dark HUD icons when using light system theme

Authored by huoni on Apr 26 2018, 6:15 AM.

Description

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:

  1. Compare / Light table mode
  2. Video controls popup
  3. 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:

  1. Compare / Light table mode
  2. Video controls popup
  3. 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

Details

Committed
huoniMay 3 2018, 11:39 PM
Reviewer
Gwenview
Differential Revision
D12595: Fix dark HUD icons when using light system theme
Parents
R260:c7b70617668d: Remember width of sidebar
Branches
Unknown
Tags
Unknown