Friday, April 19, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 970  / 2 Years ago, sun, april 17, 2022, 8:35:02

I am developing PyGTK app with appindicator. I create my appindicator similar like in this example. In this example "indicator-messages" stock icon is used.



So, I can:




  1. use stock icon (from existing theme)

  2. create custom icon



The question is, if I use stock icon, how can I determine what icons are available (is this consistent on all OS-es, is it provided by GTK)? Will this behave same on different Linux distributions?



Or, if I create custom icon, how can I detect which theme is active (I suppose I need to have dark and light icon version) and render appropriate icon? What is with other themes, looks like it's hard to support all of them?



On http://unity.ubuntu.com/projects/appindicators/ it says "Themable panel icons – you can set a specific icon to be a panel icon for an indicator: this should make it easier for creating single colour panel icons for light and dark themes." but it does not says how to achieve this?



I found Weather indicator does it, but with stock icons I think.


More From » unity

 Answers
1

For your part of the question :




if I create custom icon, how can I detect which theme is active (I
suppose I need to have dark and light icon version) and render
appropriate icon? What is with other themes, looks like it's hard to
support all of them?




you can use "gtk-theme-name" property defined in GtkSettings class to get the name of the theme which is being active.



For further information for GtkSettings check this


[#41275] Monday, April 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itchlos

Total Points: 486
Total Questions: 115
Total Answers: 110

Location: Macau
Member since Fri, Apr 28, 2023
1 Year ago
;