Coloring (unsupported) Gadgets via gtk_

Linux specific forum
broozar
User
User
Posts: 61
Joined: Sat May 08, 2010 11:21 pm
Location: Berlin, Germany

Coloring (unsupported) Gadgets via gtk_

Post by broozar »

hi everybody,

i am trying to make a dark skin for my program. some gadgets have fore- and background color settings directly supported by PB, others don't. so i was googling for the best way to override styles on a per-application basis.

1. gtk_widget_modify_fg_(*widget.GTKWidget, state, *color) ---> gtk_widget_modify_fg_(GadgetID(#some_gadget), #GTK_STATE_NORMAL, "#111111" ) either makes widgets completely black or has no effect
2. gtk_rc_parse_(*filename) ---> create/modify existing rc file and load it. my preferred method, however does not appear to work.
3. gtk_label_set_markup_ and similar functions ---> not tested. seems rather messy.
4. GTK2_RC_FILES=/path/to/your/theme/gtkrc myPBbinary ---> ignores some widgets, like tabs.

additionally, transparent PNG images seem to display the style background and not the window bg color, is that normal?

Does any of this work with KDE?
Any opinions on my approach? Recommendations?

cheers
felix
broozar
User
User
Posts: 61
Joined: Sat May 08, 2010 11:21 pm
Location: Berlin, Germany

Re: Coloring (unsupported) Gadgets via gtk_

Post by broozar »

self update: option #4 worked best for me. it took a day of fiddling with the gtkrc file, but everything is fine now.
the rendering is slightly different under KDE, but marginally.
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: Coloring (unsupported) Gadgets via gtk_

Post by uwekel »

My recommendation is to not touch the system colors. Most likely the user has them setup on HIS taste...
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
broozar
User
User
Posts: 61
Joined: Sat May 08, 2010 11:21 pm
Location: Berlin, Germany

Re: Coloring (unsupported) Gadgets via gtk_

Post by broozar »

true. but you gotta give to the employer what the employer wants :)

i am also doing this for coherence between the desktop environments. under KDE, the app looks totally different and images simply do not flow nicely into the background - even though they are PNGs with transparency and should have no problem. using a custom gtkrc file makes them look very close.

using gtkrc is a nice, unobtrusive way, since it just calls the (unskinned) binary and the style file via some simple shell script. if one prefers the unskinned version, you can just run the binary itself, which will use the system skin. this way, since nothing is hardcoded into the app, i say no harm done.
Post Reply