GTK-Themes

Differences between revisions 23 and 24
Revision 23 as of 2009-04-12 19:44:44
Size: 3627
Editor: p508958A1
Comment:
Revision 24 as of 2009-04-12 19:46:03
Size: 3595
Editor: p508958A1
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
== Make the Main Menu look different from other menus == == Making the Main Menu look different from other menus ==
Line 83: Line 83:
 * [[../GtkCssEngine|Information on the GTK-CSS Engine]] (The future of theming for Gnome)  * [[../GtkCssEngine|Information on the GTK-CSS Engine]]

The goal of this page is not to tell you how to design and implement a theme from scratch, but rather to convey some of the trickier and/or less documented parts of theming.

Suggesting a Wallpaper

In your index.theme file put a line like "BackgroundImage=/absolute/path/to/image.png" under the X-GNOME-Metatheme header. For packaged themes wallpapers should be assumed to be placed in /usr/share/wallpapers.

FIXME: Is it possible to set a specific solid color or gradient?

Setting the Background on Nautilus Special Places' Headers

To change the background color of the special headers in Search and CD-Creator put something like the following in your gtkrc:

style "extra-view-widgets"
{
   # Fx. The special header in Nautilus Search and CD Creator
   bg[NORMAL] = "#CD6127"
}

widget "*.nautilus-extra-view-widget" style:highest "extra-view-widgets"

Making the Main Menu look different from other menus

To change the background color or any other property of menuitmes, use the following code:

style "mytheme-panelmenu-item"
{
        bg[NORMAL] = "#ffffff"
       
        # add some style options that you want to modify
}
widget "*.gnome-panel-main-menu.*"  style :highest "mytheme-panelmenu-item"

To change the appearance of the menu use this matching:

style "mytheme-panelmenu" = "mytheme-menu" #this is optional inheritance from mytheme-menu
{
        bg[NORMAL] = "#F5F5F5"
        bg_pixmap[NORMAL] = "some image file"
        
}
widget "*.gnome-panel-main-menu" style :highest "mytheme-panelmenu"

Replace the placeholder mytheme with the name of your theme.

Performance Tuning and Testing of Metacity Themes

To test a Metacity theme run

metacity-theme-viewer Human

to test the Human metacity theme for instance. Your theme should render properly in all the tabs. There's also a Benchmark tab - you can use this to compare rendering speeds with other themes. The fastest ones currently, appears to be Bright, Metabox and ArtworkTeam/SandSkater.

Performance of GTK+ Themes

There is a benchmarking tool for GTK+ themes called GtkPerf.

Pixel Precision

Sometimes it can be hard to tell whether you are missdrawing one pixel or it is just your eyes itching from hours of intense staring at the screen. Try running xmag from the command line and click on the screen area you want to inspect. This gives you a magnification of the area you click on.

Another option would be to use the Enhanced Desktop Zoom plug-in that comes with Compiz-Fusion (if your PC is capable of running advanced effects with compiz, of course). You should remove the check from Filter Linear checkbox in the Animation tab of the plugin's preferences in order to see the individual pixels. Zooming is usually done with pressing Super key and scrolling the mouse.


CategoryArtwork

Artwork/Documentation/GTK-Themes (last edited 2009-04-12 19:46:03 by p508958A1)