digitaltrails / jouno

Systemd journal to Freedesktop notifications forwarder.
GNU General Public License v3.0
6 stars 0 forks source link

Use a light icon in KDE when the global theme is light but Plasma theme is dark #2

Closed jinliu closed 8 months ago

jinliu commented 8 months ago

Screenshot_20231225_172340

In theory, this could be done by using a current-color-scheme CSS in SVG_JOUNO, as in SVG_TOOLBAR_RUN_DISABLED and others. But adding that makes the icon invisible.

digitaltrails commented 8 months ago

Because jouno isn't a KDE application, I don't think I have a way to automatically achieve this. What I could do is bring over some code from vdu_controls issue #66 which would introduce settings that switch a monochrome panel icon and a second switch for light-on-dark or dark-on-light: Screenshot_20231226_080523

digitaltrails commented 8 months ago

Pushed f9c8bfa which adds a dark-tray setting, as can be seen here with the Breeze Twilight theme:

Screenshot_20231228_074955-2

digitaltrails commented 8 months ago

I've looked for methods on QSystemTrayIcon which could provide a way to find out if the tray is dark. There don't appear to be any. I noticed that the tooltip text is themed, but there is no method to get at the palette or font used. There is also no method to obtain any style information.

I also looked app.stylesheet(), but that returns an empty string.

So I'm kind of stuck for how to achieve this without a manual setting.

jinliu commented 8 months ago

Thank you very much!

https://github.com/nextcloud/desktop has a tray icon that adapts to the tray color. But seems it's using KDE's built-in cloudstatus icon, and I can't find the reference to that icon in the source code, so that might not help.

digitaltrails commented 8 months ago

Thank you very much!

https://github.com/nextcloud/desktop has a tray icon that adapts to the tray color. But seems it's using KDE's built-in cloudstatus icon, and I can't find the reference to that icon in the source code, so that might not help.

Unless it's pure Qt or accessable from Qt calls I probably can't use it. It would be best if it worked for gnome, deepin and the rest.

Having one extra setting isn't a big deal, that will have to do.