applet icon color for light and dark themes

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Post Reply
matther
Level 1
Level 1
Posts: 10
Joined: Wed Feb 07, 2024 5:57 pm

applet icon color for light and dark themes

Post by matther »

I'm writing an applet and wrote the svg for the set_applet_icon_symbolic_path. I didn't like to but set the color with fill: #fff.
Works nice if the Panel is dark. Doesn't work if the Panel is light.

Is there any magic for the coloring of the icons? There could be reserved class names or css variables for primary and secondary colors, perhaps for an active state.
Or do you take different icons for different themes. But how do you know which icon to take? I miss some documentation on applet icons.
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: applet icon color for light and dark themes

Post by Drugwash »

Dunno if this could be of any help but here's a blog entry where symbolic icons were discussed. Maybe something clicks.
matther
Level 1
Level 1
Posts: 10
Joined: Wed Feb 07, 2024 5:57 pm

Re: applet icon color for light and dark themes

Post by matther »

The blog entry is interesting. It says many things about the why but nothing about the how.

And in a little older posting: 21.3 needs RAM (4GB recommended for a comfortable usage). So I think the performance of your computer wouldn't be a problem.
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: applet icon color for light and dark themes

Post by Drugwash »

matther wrote: Thu Feb 08, 2024 4:05 pm It says many things about the why but nothing about the how.
Maybe analyzing the official symbolic icons in the Mint themes could reveal how they are built. Inkscape should be able to show the inner works of those SVGs.
matther wrote: Thu Feb 08, 2024 4:05 pm I think the performance of your computer wouldn't be a problem.
This 19.2 is almost at 2.5GB usage now with only a browser (Pale Moon, quite light compared to Firefox and others), the e-mail app (ClawsMail), text editor (CudaText) and file manager (Double Commander). Oh and also three small AHK compiled apps of mine running under WINE.
When I fire up a VM of Mint 21.3 the RAM usage goes almost up to the whole 8GB. And that's only running the OS in the VM, not any memory-hungry applications.

If I hypothetically were to install 21.3 I might not be able to run any VM within it, and certain applications might choke it due to high RAM usage. Couldn't take that chance - not to mention I can't stand how they chopped it to pieces, throwing out theming and window options while adding completely useless (to me) gimmicks.

Long ago I used to "live on the edge", installing and using the very latest - many times alpha - versions of various applications, as long as the devs were adding features and options. But when you take out features and options that I use [almost] daily and call it improvements, you lost me as a client. Forever. 8)
matther
Level 1
Level 1
Posts: 10
Joined: Wed Feb 07, 2024 5:57 pm

Re: applet icon color for light and dark themes

Post by matther »

The solution was easier than expected.

Add -symbolic to the filename

Applet.IconApplet has 4 icon functions. 2 for icons by name. And these two

.set_applet_icon_symbolic_path ()
.set_applet_icon_path ()

Found in Grenoble

Using my icon with the .set_applet_icon_path results in an icon in the size of the colored App Icons. Using .set_applet_icon_symbolic_path renders icons in the size of the other monochrome status icons.

With a filename like "icon.svg" I can set the fill and stroke colors for the svg elements and it gets rendered colorful. If I use "icon-symbolic.svg" the fill and stroke style attributes get ignored and get set by the theme.

SVG is plain xml. Its quiet readable. See here
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: applet icon color for light and dark themes

Post by Drugwash »

Nice find that Grenoble. Browsing it right now. :)

Guess I once knew about icon filenaming but forgot together with many other things. Memory is not what it used to be, among others. :oops:

SVG looks... weird "inside". I've checked out a few in the past, I'm not fond of XML in any shape or form. Old school here. :)

Glad you found your answer and it's an easy one. Good luck! :wink:
Post Reply

Return to “Programming & Development”