Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-01-23 20:50:06

crimson
Member
Registered: 2016-01-23
Posts: 7

Menu background color of tray applets

Hi,
I'm working on my gtk2 theme for xfce 4.10 (xubuntu 12.04), and stumbled on a small, but irritating problem. Is there a way to change the tray applets menu background color, eg. the volume control, wi-fi, bluetooth, without changing the menu background color system-wide? I'm quite sure its just the matter of applying a style to a specific widget or class in the gtkrc file, but the on-line research didn't bring any solution. Please advise.

I've attached a screenshot of example menu, which background color I would like to change.

Thank you in advance
Regards

K02Q7RF.png

Offline

#2 2016-01-24 14:58:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Menu background color of tray applets

That looks like the xfce4-indicator-plugin running the indicator-sound applet. If so, indicator-sound is a GTK3 applet, so you'll need to edit your GTK3 configs to get it to match.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-01-24 18:41:19

crimson
Member
Registered: 2016-01-23
Posts: 7

Re: Menu background color of tray applets

To my knowledge this is still gtk2, but I will try to fiddle around the gtk.css for gtk3. In the meantime, in the gtkrc file for gtk2, I can style the menu like this:

style "menu"
{
	ythickness        = 3
	xthickness        = 0
	GtkMenuBar	:: shadow-type		= GTK_SHADOW_NONE
	
	bg[SELECTED]      = @selected_bg_color
	bg[NORMAL]        = shade (1.18, @bg_color)
	bg[PRELIGHT]      = @selected_bg_color
	bg[ACTIVE]        = shade (1.18, @bg_color)
	bg[INSENSITIVE]   = shade (1.18, @bg_color)
	fg[NORMAL]        = @fg_color # Color for normal text.
	fg[PRELIGHT]      = @base_color
	fg[SELECTED]      = @base_color
	fg[ACTIVE]        = @base_color
	fg[INSENSITIVE]   = mix (0.4, @fg_color, @bg_color) # Text color for non-interactive menu items
	text[NORMAL]      = @text_color # Color for menu-item radio/checks.
	base[NORMAL]      = @bg_color # Color for menu-item radio/checks background.
	text[PRELIGHT]    = @base_color
	text[SELECTED]    = @base_color
	text[ACTIVE]      = @base_color
	text[INSENSITIVE] = @text_color
	
	engine "murrine" 
	{
		roundness = 0 # Roundness of menu items.
		gradient_shades = {1.25,1.1,1.1,1.0}
		contrast = 0.9
		lightborder_shade = 1.5
	}
}

and apply the style, by calling the GtkMenu widget class:

widget_class "*<GtkMenu>*"              style "menu"

When I will change the bg[NORMAL] to eg #cecece, then all menus system-wide, including those in tray, will change to background color to the one defined by me. So I am able to affect the tray menus as well. Now, going back to my original question, is there a method to call a widget_class, widget or class in order to style only the tray menus? For example, this is how I change the appearance of my calendar.

style "wide"
{
	xthickness = 1
	ythickness = 1
}
style "calendar"
{
	fg[NORMAL]	= "#FFFFFF"
	fg[PRELIGHT]	= "#FFFFFF"
	bg[NORMAL]	= shade (0.6, @bg_color_dark)
	bg[PRELIGHT]	= shade (0.8, @selected_bg_color)
}
class "GtkCalendar"  style "wide"
widget_class "*GtkCalendar*"	style "calendar"

Regards

Offline

#4 2016-01-24 19:10:56

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: Menu background color of tray applets

crimson wrote:
widget_class "*<GtkMenu>*"              style "menu"

yeah because you themed all GTKMenus with that rule, to theme just one widget you need to use the widget rule: https://wiki.gnome.org/Attic/GnomeArt/T … et_matches

Offline

#5 2016-01-30 20:46:02

crimson
Member
Registered: 2016-01-23
Posts: 7

Re: Menu background color of tray applets

Hi,
Sorry it toke me so long to respond, but work got in my way ;-)
sixsixfive, I've tried to figure out the correct names of the menus in tray, but didn't succeed. Following the tutorial on the website, which you've provided (and a little bit of personal trial-and-error experience), I think that in order to apply the custom style to the menus in tray, the code should be like this

widget_class "*<GtkMenu>.<Here-should-be-the-name-of-the-desired-menu-in-tray>"	style "my-style"

Any ideas on what to type in place of "Here-should-be-the-name-of-the-desired-menu-in-tray"?

Regards

Offline

#6 2016-01-31 08:32:11

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: Menu background color of tray applets

no, I have no idea which panel plugin you use(i've never seen that thing) but have a look into the c-source if the widget names are defined somewhere then there)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 546.38 KiB (Peak: 547.23 KiB) ]