Closed varlesh closed 5 years ago
Also CSS style not supported too ((
ColorScheme-Text
must be used text from plasma color scheme. But this ignored on widget icon and used original color #4d4d4d
Ah, this means I need to define the Plasmoid.compactRepresentation
using my AppletIcon workaround. It still hardcodes the svg path, but it'll use the correct color scheme.
I use ColorScheme-Text
, but I forgot the default compactRepresentation uses PlasmaCore.IconItem
which doesn't apply the color scheme to svg's loaded from an absolute filepath (which is what plasmoid.file(...)
returns). It only applies it to "icon names" without the file extension + path that are loaded from your icon theme.
https://github.com/KDE/plasma-framework/blame/master/src/declarativeimports/core/iconitem.cpp#L133
https://github.com/KDE/kiconthemes/blob/master/src/kiconloader.cpp#L922
https://github.com/KDE/plasma-framework/blob/master/src/plasma/svg.cpp#L88
Hmmmm...
This looks interesting though... it seems it might be able to load it from the "images" folder.
I tried renaming my contents/icons/
folder to contents/images/
. While the following code works, it still doesn't load follow the color scheme, as it's still returning an absolute filepath.
Plasmoid.icon: plasmoid.file("images", "octicon-mark-github.svg")
And neither of these loads the svg, which means I don't fully understand how iconitem.cpp
works.
Plasmoid.icon: "octicon-mark-github"
Plasmoid.icon: "octicon-mark-github.svg"
I'd need to recompile plasma-framework
with a ton of qDebug() << "test";
to find out how that string is treated...
@Zren if you interested, i'm draw Breeze style icons (dark and light)... Another way - you can add option switch icon for light/dark color scheme. preview: sources SVG: icons.tar.gz
Ah sorry, it seems I forgot to push the commit that uses my AppletIcon.qml
that loads the icon using PlasmaCore.SvgItem
instead of using PlasmaCore.IconItem
.
https://github.com/Zren/plasma-applet-githubissues/commit/35d2217a7cdf98cc08269888f041cb37265eedc3
Seems I also have a little bit of uncommitted code that fixed the multi-repo TextField. Might clean that up and release the multi-repo refactor today as it's worked great for the past month.
@Zren Yes, now colorscheme worked... but need fix icon size: I'm update svg: octicon-mark-github.tar.gz
Ah good point, normal svg icons usually have a 2px padding in their paths and mine was going right to the edge. Thanks for the updated path!
Icon fixed in the v3 release.
Will be good added support use tray icon from plasma theme and original icon as fallback. Now this hardcoded: