A few notes to explain how to theme gmusicbrowser using customs gtk themes.
Feel free to improve this page.
First you need to have some knowledge about how gtk themes works, this page have all the technical details, but there is also some tutorials.
To launch gmusicbrowser with a custom gtkrc file, you can type this :
GTK2_RC_FILES=gtkrc gmusicbrowser
replace gtkrc by the full or relative path and filename.
To help finding the path of widgets you want to theme, I've added some functions to my Debug.pm plugin, you can find it there (put it in ~/.config/gmusicbrowser/plugins/).
Note that some things will not work with version older than 1.0.2 (widget names and the WB container).
Example of what you can put in a gtkrc file :
style "test"
{ bg[NORMAL] = "#000000"
fg[NORMAL] = "#ffffff"
base[NORMAL] = "#000000"
text[NORMAL] = "#ffffff"
}
widget_class "*" style "test"
This define the style “test”, the style simply defines the 4 colors bg, fg, base, and text in the “NORMAL” state. Widgets use some or all of these colors to draw themselves. A widget can be in 5 states : NORMAL, ACTIVE, PRELIGHT, SELECTED and INSENSITIVE.
The theme is applied to all widgets which class_path match “*”, that is all widgets. The class_path is a string made of the class name of all widget and all of its parents, joined by a period ”.”, the character “*” match 0 or more characters.
For example, the “Total” gmb widget is made up of a gtkbutton containing a gtklabel. In the Browser layout the gtk_label of Total has this class_path : GtkWindow.SVBox.SHBox.GtkButton.GtkLabel
So to apply the style “test” to only the gtklabel of the Total widget, you would have to use :
widget_class "GtkWindow.SVBox.SHBox.GtkButton.GtkLabel" style "test"
But, this has a few problems :
Browser.VBmain.HBstatus.Total.GtkLabelSo by modifying the Browser layout like this :
the path of “Total”'s gtklabel becomes : Browser.VBmain.HBstatus.WBTotal.Total.GtkLabel
And with a gtkrc of :
style "test" = "theme-default"
{ bg[NORMAL] = "#000000"
fg[NORMAL] = "#ffffff"
base[NORMAL] = "#000000"
text[NORMAL] = "#ffffff"
}
widget "Browser.*WBTotal*" style "test"
Note that this time it uses “widget” instead of “widget_class” to match against the path of the widget instead of its class_path. The style “test” is applied to all gtk widgets named WBTotal and their children, only in a the “Browser” Layout. And the background of the button is black in NORMAL state.