Created attachment 168682 [details] cat icon have a wrong color* SUMMARY Using a plasmoid icon with an absolute path (Qt.resolvedUrl(***)) uses the wrong color scheme when using Breeze Twilight. STEPS TO REPRODUCE 1. Download any community plasmoid (e.g. CatWalk)l. 2. Place it on panel. 3. Switch to Breeze Twilight. OBSERVED RESULT Dark icon on dark panel. EXPECTED RESULT Light icon on dark panel. SOFTWARE/OS VERSIONS Operating System: Manjaro Linux KDE Plasma Version: 6.0.4 KDE Frameworks Version: 6.1.0 Qt Version: 6.7.0 Kernel Version: 6.8.7-1-MANJARO (64-bit) Graphics Platform: Wayland Processors: 12 × Intel® Core™ i5-10500H CPU @ 2.50GHz Memory: 15.4 ГиБ of RAM ADDITIONAL INFORMATION Community widgets behave the same way in the system tray (if the icon is not from the theme).
Cannot confirm with Breeze light or Breeze Dark; works there. Can confirm with Breeze Twilight--which is to say, it's broken with mixed light/dark themes. Looking at the code to ss if it;'s our bug our yours. JFYI I absolutely adore CatWalk. It's dangerously adorable. I need a version for memory too! Maybe the can can get fat or something.
I can confirm that if I replace `Qt.resolvedUrl(something` with something from the theme like "widgets/clock", that SVG correctly keeps the Plasma coloration rather than inappropriately using the app coloration. Possibly this is multiple bugs—one in KSvg and one in Kirigami.icon—but maybe they share a root cause. Moving to libplasma for now, and Marco can say what else we need to do.
(In reply to Nate Graham from comment #1) > Cannot confirm with Breeze light or Breeze Dark; works there. Can confirm > with Breeze Twilight--which is to say, it's broken with mixed light/dark > themes. Looking at the code to ss if it;'s our bug our yours. > > JFYI I absolutely adore CatWalk. It's dangerously adorable. I need a version > for memory too! Maybe the can can get fat or something. Okay, what kind of visualization should I do for memory? Is a refillable glass ok? )))
Whatever it is, it needs a cute cat! Maybe the more memory your system is using, the more the cat looks like Garfield. Anyway, off-topic here, sorry lol
Reading the KSVG code this seems to be somewhat intentional. The documentation for KSvg::Svg (https://invent.kde.org/frameworks/ksvg/-/blob/master/src/ksvg/svg.h?ref_type=heads#L39) says > Unless an absolute path to a file is provided, it loads the SVG document using KSvg::ImageSet and in https://invent.kde.org/frameworks/ksvg/-/blob/master/src/ksvg/svg.cpp#L466 svgs with absolute paths are considered unthemed
Same with Kirigami.Icon, coloring is explicitly disabled for absolute paths: https://invent.kde.org/frameworks/kirigami/-/blob/master/src/icon.cpp?ref_type=heads#L542
I wonder what the reason for that is. In this use case at least, we want the SVG to be themed.
(In reply to Nicolas Fella from comment #5) > Reading the KSVG code this seems to be somewhat intentional. > > The documentation for KSvg::Svg > (https://invent.kde.org/frameworks/ksvg/-/blob/master/src/ksvg/svg. > h?ref_type=heads#L39) says > > > Unless an absolute path to a file is provided, it loads the SVG document using KSvg::ImageSet > > and in > https://invent.kde.org/frameworks/ksvg/-/blob/master/src/ksvg/svg.cpp#L466 > svgs with absolute paths are considered unthemed This is a very, very old thing that's there since 4.0 times, but i think the behavior in that it could be safely changed: as if the svg has the proper stylesheet things would always be styled, otherwise it wouldn't be anyways, so i don't see danger in changing this
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ksvg/-/merge_requests/48
So https://invent.kde.org/frameworks/ksvg/-/merge_requests/48 attempts to always recolor images also the ones "non themed" as in taken from somewhere else in the filesystem Now this should be checked for possible sideeffect.... worst case scenario can be added api about it, to not change default behavior
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/1547
Git commit 058602054c4a7483a442e0e1c3f701ac086fedb9 by Marco Martin. Committed on 13/05/2024 at 07:42. Pushed by mart into branch 'master'. Color also absolute path images Also images that are loaded with an absolute path should get colored by the current KSvg ImageSet, this comes from an old recoloring limitation that existed before the stylesheet based one M +2 -1 autotests/data/plasma/desktoptheme/testtheme/colors M +31 -0 autotests/framesvgtest.cpp M +1 -0 autotests/framesvgtest.h M +59 -72 src/ksvg/private/imageset_p.cpp M +0 -1 src/ksvg/private/imageset_p.h M +0 -1 src/ksvg/private/svg_p.h M +5 -26 src/ksvg/svg.cpp https://invent.kde.org/frameworks/ksvg/-/commit/058602054c4a7483a442e0e1c3f701ac086fedb9
Git commit 86f021548fec3ec8bd2423d7775d375acee5bfd6 by Marco Martin. Committed on 14/05/2024 at 18:45. Pushed by mart into branch 'master'. Always color icons tint kirigami icons even if they are passed by absolute path A +18 -0 autotests/stop-icon.svg M +25 -0 autotests/tst_icon.qml M +5 -8 src/primitives/icon.cpp https://invent.kde.org/frameworks/kirigami/-/commit/86f021548fec3ec8bd2423d7775d375acee5bfd6