Bug 491274 - Monochrome icons are not colored correctly in task manager with mixed themes
Summary: Monochrome icons are not colored correctly in task manager with mixed themes
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: Master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-04 19:07 UTC by Nicolas Fella
Modified: 2024-08-20 12:34 UTC (History)
4 users (show)

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


Attachments
Screenshot (15.29 KB, image/png)
2024-08-04 19:07 UTC, Nicolas Fella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2024-08-04 19:07:27 UTC
Created attachment 172278 [details]
Screenshot

STEPS TO REPRODUCE
1. Use dark Plasma and light applications theme 
2. Open any app that has a monochrome/symbolic app icon, e.g. the DrKonqi Crashed Processes viewer
3. Look at the task manager

OBSERVED RESULT
The icon elements are dark. See screenshot

EXPECTED RESULT
The icon elements are light

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 6.8
Comment 1 Nicolas Fella 2024-08-04 19:11:37 UTC
The cause:
- libtaskmanager resolves the icon for the app and loads it via QIcon::fromTheme
- the UI passes that QIcon to Kirigami.Icon
- the libplasma kirigami plugin usually makes sure that icons are loaded with the right colors, but it doesn't apply here because we don't pass a name to Kirigami.Icon but a QIcon directly
Comment 2 Bug Janitor Service 2024-08-04 19:15:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/1603
Comment 3 Nicolas Fella 2024-08-14 15:27:55 UTC
Git commit f673694e6f90efa0179a6f8322d4c44d544ff591 by Nicolas Fella.
Committed on 14/08/2024 at 12:43.
Pushed by nicolasfella into branch 'master'.

[icon] Fix icon colors when using Plasma platformtheme and QIcon source

When using a name as source we load the icon from the platform theme and
therefore apply the right theme colors.

However when we receive a QIcon as source it might not have been loaded
with the right theme colors.

To fix this check if the icon was obtained by name and reload it from the
platformtheme then. The late PlasmaCore.IconItem did something similar.

M  +20   -6    src/primitives/icon.cpp
M  +1    -0    src/primitives/icon.h

https://invent.kde.org/frameworks/kirigami/-/commit/f673694e6f90efa0179a6f8322d4c44d544ff591