Bug 472864 - Monochrome icons in Kickoff and Kicker have wrong colors with mismatched Plasma and app color schemes
Summary: Monochrome icons in Kickoff and Kicker have wrong colors with mismatched Plas...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) widget (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Nate Graham
URL:
Keywords: qt6, regression
Depends on:
Blocks:
 
Reported: 2023-08-01 04:24 UTC by Nate Graham
Modified: 2023-08-31 01:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2023-08-01 04:24:02 UTC
Following the porting to use Kirigami.Icon, any app or location entries in Kickoff and Kicker that use monochrome rather than colorful icons get the wrong colors when using mismatches Plasma and app color schemes. For example with breeze Twilight.

The issues does not affect other applets, just these two.
Comment 1 Nate Graham 2023-08-30 21:39:43 UTC
Strangely the colors of monochrome icons are correct when they appear in the search view; they're only wrong in the browse views.
Comment 2 Nate Graham 2023-08-30 21:48:54 UTC
Kicker is also affected; looks like the problem is in the model, with whatever provides the "Decoration" role.
Comment 3 Nate Graham 2023-08-30 21:55:44 UTC
It looks like the various models return instances of QIcon using QIcon::fromTheme(), which is then handed off the Kirigami.Icon. Either Kirigami.Icon is not able to color-change them properly, or else the design of returning a QIcon is itself flawed and we should always return an icon name or absolute file path, and count on Kirigami.Icon to handle those appropriately.
Comment 4 Nate Graham 2023-08-30 22:07:52 UTC
Ok, I think I've fixed it. Patch incoming soon.
Comment 5 Bug Janitor Service 2023-08-30 22:27:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3233
Comment 6 Nate Graham 2023-08-31 01:28:56 UTC
Git commit f6628194399d3347c328732ffbf79f601ff7e89c by Nate Graham.
Committed on 31/08/2023 at 00:24.
Pushed by ngraham into branch 'master'.

Don't return QIcons for Kicker models

When the models return QIcons, the result is icon data that's recolored
by KIconLoader according to the system color scheme. However these
returned QIcons may be displayed by Kirigami.Icon instances in Kickoff
and other applets using a different Plasma color scheme from the
systemwide one, and then the icons will be colored incorrectly.

We can fix the issue by removing usages of QIcon and instead returning
the icon names or file paths directly; Kirigami.Icon can handle them
both internally and perform the recoloring correctly for all plasma and
systemwide colorscheme combinations.

M  +2    -2    applets/kicker/plugin/abstractentry.cpp
M  +1    -2    applets/kicker/plugin/abstractentry.h
M  +5    -22   applets/kicker/plugin/appentry.cpp
M  +4    -4    applets/kicker/plugin/appentry.h
M  +1    -2    applets/kicker/plugin/computermodel.cpp
M  +3    -3    applets/kicker/plugin/fileentry.cpp
M  +1    -1    applets/kicker/plugin/fileentry.h
M  +1    -2    applets/kicker/plugin/recentusagemodel.cpp
M  +2    -2    applets/kicker/plugin/rootmodel.cpp
M  +1    -1    applets/kicker/plugin/rootmodel.h
M  +0    -1    applets/kicker/plugin/runnermatchesmodel.cpp
M  +2    -2    applets/kicker/plugin/simplefavoritesmodel.cpp
M  +3    -3    applets/kicker/plugin/systementry.cpp
M  +1    -1    applets/kicker/plugin/systementry.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/f6628194399d3347c328732ffbf79f601ff7e89c