bouteillerAlan / archupdate

widget for kde plasma ~ count the pacman update available
GNU General Public License v3.0
37 stars 4 forks source link

Icon invisible in panel with dark theme [plasma 6] #46

Closed kinoegit closed 5 months ago

kinoegit commented 5 months ago

xxx Panel icon is black on black with tested dark global themes (breeze dark & breeze twilight) and ca 20 different plasma themes, icon sets & color settings. View other icons (nextcloud and solaar) seem to have got the same issue. I wonder whether the issue has got to do with porting to plasma 6 ?

bouteillerAlan commented 5 months ago

Hey, what is your distro ? I need to dig this bug since I have a dark theme and everything is working fine ^^ image

Thanks for the link, I read that and look if an update is needed ! (maybe today or tomorrow)

kinoegit commented 5 months ago

Sure: Operating System: Arch Linux KDE Plasma Version: 6.0.1 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Kernel Version: 6.7.9-arch1-1 (64-bit) Graphics Platform: Wayland Graphics Processor: Mesa Intel® UHD Graphics 630

bouteillerAlan commented 5 months ago

On a side note, the color is set here.

bouteillerAlan commented 5 months ago

Ok I can reproduce with breeze twilight image

luisbocanegra commented 5 months ago

I think the problem here is that Plasma only sets colors for named icons (those that come from the icon theme), and not to user selected ones (those that come from a absolute path or a Qt.resolvedUrl). Even when the icon has css colors correctly defined.

Maybe they do this with the assumption that the user may give a full-color icon or this could be a bug?

The alternative I found is to use Kirigami.Icon instead with isMask: true:

Kirigami.Icon {
    id: svgItem
    opacity: 1
    width: parent.width
    height: parent.height
    property int sourceIndex: 0
    anchors.centerIn: parent
    smooth: true
    isMask: true
    source: Qt.resolvedUrl("../../assets/" + root.source)
}

It has the downside of making the icons have a single color though so no accent/highlight etc. from the icon's css.

bouteillerAlan commented 5 months ago

I have tested with some global theme and, in most of the case, that work :)

Maybe we can add an option to customize the color of the icon ? If the user uses the color by default we use the code you provide and if he uses a custom color we use the provided custom color. Like so if the default color is not the right color, the user have the possibility to make it right by himself.

What do you think @luisbocanegra ?

luisbocanegra commented 5 months ago

I think we can set the icon with isMask true and and Kirigami.Theme.textColor as the default color. About making it configurable is up to you, I recolor them anyway with the colorizer thingy anyway :)

bouteillerAlan commented 5 months ago

Okai see #48

kinoegit commented 5 months ago

After yesterdays update of Plasma 6.0.2 the color issue of systray icons was fixed! So it was an upstream bug!?