Try to apply the colorscheme of the current theme to QIcons
ClosedPublic

Authored by davidre on Feb 22 2020, 10:15 PM.

Details

Summary

Before icons loaded internally with QIcon::fromTheme were being colored with the
colors from the current global color scheme instead of the ones from the current
Plasma Theme. Leading to visual bugs when the two differ. This happened because
KIconLoader uses the global color scheme by default.
A prominent case is the notification send by the network plasmoid when one
successfully connected to a wireless network. It sets the icon
"network-wireless-on" which is not included in Breeze icons (but is included in
Breeze Plasma Theme). If the current icon theme is indeed Breeze, IconItem
resorts to using QIcon::fromTheme and we end up with a wrong colored
"network-wireless" icon.

BUG: 417780

Test Plan

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.Feb 22 2020, 10:15 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 22 2020, 10:15 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidre requested review of this revision.Feb 22 2020, 10:15 PM
davidre edited the test plan for this revision. (Show Details)Feb 22 2020, 10:16 PM
davidre added a reviewer: Plasma.
cblack accepted this revision.Feb 22 2020, 10:26 PM
cblack added a subscriber: cblack.

Patch works as advertised and the code LGTM.

This revision is now accepted and ready to land.Feb 22 2020, 10:26 PM

Yes seems like the exact bug

davidre edited the summary of this revision. (Show Details)Feb 23 2020, 8:50 AM

Confirmed. I tried out the patch now, and that problem is gone.

ngraham accepted this revision.Feb 23 2020, 4:32 PM
mart requested changes to this revision.Feb 24 2020, 11:09 AM
mart added a subscriber: mart.
mart added inline comments.
src/declarativeimports/core/iconitem.cpp
600

maybe Plasma::Theme should have a qpalette getter?

This revision now requires changes to proceed.Feb 24 2020, 11:09 AM
davidre updated this revision to Diff 76284.Feb 24 2020, 1:37 PM
  • Introduce Plasma::Theme::palette
mart accepted this revision.Mar 2 2020, 10:52 AM
This revision is now accepted and ready to land.Mar 2 2020, 10:52 AM
This revision was automatically updated to reflect the committed changes.