Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
xfwm4_theme_howto [2006/12/02 16:05] – nick | xfwm4_theme_howto [2007/12/08 17:55] (current) – removed 88.172.125.130 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Xfwm4 theme how-to ====== | ||
- | |||
- | |||
- | ===== Introduction ===== | ||
- | Xfwm4, Xfce4' | ||
- | |||
- | {{ howto: | ||
- | |||
- | ===== Themes locations ===== | ||
- | In Xfwm4 version 4.0, the themes are searched in the following directories: | ||
- | |||
- | * User's home dir / | ||
- | * System' | ||
- | |||
- | In Xfwm version 4.2, the theme location is in line with the standard, searched in the following directories: | ||
- | |||
- | * User's home dir / | ||
- | * System' | ||
- | |||
- | |||
- | ===== Titlebar decorations ===== | ||
- | As windows can be in either active ((focused)) or inactive ((unfocused)) states for which xfwm4 use pixmaps named accordingly e.g. title-1-active.xpm and title-1-inactive.xpm. | ||
- | |||
- | For title bar decorations, | ||
- | |||
- | {{ howto: | ||
- | |||
- | Pixmaps of a xfwm4 window | ||
- | The same naming convention is true for unfocused windows with the word inactive substituted.e.g. title-1-inactive.xpm | ||
- | |||
- | Title text colour and shadow options, alignment etc are set in the themerc file (detailed in the themerc section). | ||
- | |||
- | ===== Window Sidebars and bottom ===== | ||
- | Each side of a window is made up of two pixmaps. The pixmaps on the left side are named left-active.xpm and bottom-left-active.xpm. with the right side (of course) being made up of right-active.xpm and bottom-right.active.xpm. | ||
- | |||
- | The Window bottom grab bar is made up of bottom-active.xpm and bottom-inactive.xpm pixmaps which will be repeated to fit as the window is resized. | ||
- | |||
- | N.B These pixmaps also make up the mouse grab handles so keep that in mind when deciding how many pixels wide they should be (particularly the bottom-left and bottom right pixmaps which make up the main resize handles on the windows). | ||
- | Xfwm4 Buttons | ||
- | |||
- | Xfwm4 can use up to six action buttons - stick (sticky windows), menu, shade, hide, maximize and close. | ||
- | |||
- | Buttons have active ((focused)), | ||
- | AbiWord Image menu-active.gif | ||
- | |||
- | Figure 3 - Xfwm4 button states | ||
- | |||
- | Xfwm4 can also used " | ||
- | AbiWord Image stick-active.gif | ||
- | |||
- | Figure 4 - Stick buttons with extra toggled buttons | ||
- | |||
- | ===== Themerc file ===== | ||
- | |||
- | To set features such as title text colors, " | ||
- | |||
- | ==== Button layout ==== | ||
- | It is also possible to " | ||
- | |||
- | # button_layout : | ||
- | # O = Option menu | ||
- | # T = Stick | ||
- | # H = hide | ||
- | # S = shade | ||
- | # M = maximize | ||
- | # C = close | ||
- | # | = title | ||
- | button_layout=OTS|HMC | ||
- | |||
- | A working example of this is the " | ||
- | |||
- | ==== Title width ==== | ||
- | Another setting that needs to be set from the " | ||
- | |||
- | When set to " | ||
- | |||
- | When set to " | ||
- | |||
- | ==== Text shadow ==== | ||
- | A shadow can be added to the title text by setting the boolean value " | ||
- | |||
- | ==== Title offset ==== | ||
- | The title text position can be adjusted to fit the theme design by using the offset values. The horizontal and vertical values can be adjusted by using the following settings: | ||
- | |||
- | * title_horizontal_offset | ||
- | * title_vertical_offset_active | ||
- | * title_vertical_offset_inactive | ||
- | |||
- | ==== Button offset and spacing ==== | ||
- | Simlilarily, | ||
- | |||
- | The " | ||
- | |||
- | ===== Gtk Color pickup ==== | ||
- | As you have no doubt noticed when using Xfwm4' | ||
- | |||
- | The color symbols are as follow : | ||
- | ^ Name ^ Description ^ | ||
- | | active_text_color | Text color on title for active window | | ||
- | | inactive_text_color | Text color on title for inactive window | | ||
- | | active_border_color | Very rarely used usually set to black | | ||
- | | inactive_border_color | Idem | | ||
- | | active_color_1 | Background color for active title | | ||
- | | active_hilight_1 | Lighter color for active title for 3D look | | ||
- | | active_shadow_1 | Darker color for active title for 3D look | | ||
- | | active_mid_1 | Slightly darker color for active title | | ||
- | | active_color_2 | Background color for active window | | ||
- | | active_hilight_2 | Lighter color for active window | | ||
- | | active_shadow_2 | Darker color for active window | | ||
- | | active_mid_2 | Slightly darker color for active window | | ||
- | | inactive_color_1 | Background color for inactive title | | ||
- | | inactive_hilight_1 | Lighter color for inactive title for 3D look | | ||
- | | inactive_shadow_1 | Darker color for inactive title for 3D look | | ||
- | | inactive_mid_1 | Slightly darker color for inactive title | | ||
- | | inactive_color_2 | Background color for inactive window | | ||
- | | inactive_hilight_2 | Lighter color for inactive window | | ||
- | | inactive_shadow_2 | Darker color for inactive window | | ||
- | | inactive_mid_2 | Slightly darker color for inactive window | | ||
- | |||
- | The symbols get replaced by the actual color values at runtime so that the window borders inherits GTK theme colors automatically. | ||
- | Xpm file format used natively by xfwm4 is no more than a plain text file that can be edited with your favorite text editor. | ||
- | |||
- | ===== From Wikipedia, the free encyclopedia. ===== | ||
- | XPM (X PixMap) is an ASCII image format used by the X Window System. It was created in 1989 by Daniel Dardailler and Colas Nahaboo working in Inria Laboratories, | ||
- | |||
- | Therefore, if you open an xpm file with your favorite text editor, you'll see something like this: | ||
- | |||
- | /* XPM */ | ||
- | static char * title_2_active_xpm[] = { | ||
- | "5 21 10 1", | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | "# | ||
- | " | ||
- | " | ||
- | "& | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | |||
- | Not going too deep into the details of the XPM format, an XPM image is made of different sections, the values that describe the format of the image, the colors that compose the image, the pixels (and there is also the extensions, but it's safe to ignore them for now) | ||
- | |||
- | A character is assigned to each color of the image (if the image has more colors than available charaters, then more than a single character can be assiged to a colors). | ||
- | |||
- | To get the gtk colors applied to your theme, you need to edit the XPM files and add the proper color symbols to the color definition table. | ||
- | |||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | "# | ||
- | " | ||
- | " | ||
- | "& | ||
- | " | ||
- | " | ||
- | |||
- | must be changed to | ||
- | |||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | "# | ||
- | " | ||
- | " | ||
- | "& | ||
- | " | ||
- | " | ||
- | |||
- | As a matter of fact, " | ||
- | |||
- | ===== Xfwm 4.2 new functionality ===== | ||
- | As simple as it is, the color symbol replacement table of the XPM format is not powerfull enough to achive the nice color gradients seen in most recent themes. | ||
- | |||
- | Xfwm 4.2 includes yet another functionality that gives real nice result while being still compatible with the previous theme format: It composes the final image from the XPM file and it colors replacement table, and another PNG file with transparency, | ||
- | |||
- | xfwm 4.2 compose image | ||
- | |||
- | The names of the PNG files are identical to the names of the corresponding XPM files, with the " | ||
- | |||
- | This technique has several advantages: | ||
- | |||
- | * It's fairly simple from a theme designer point of view, most people are working with similar techniques when compising themes with tools such as The GIMP. | ||
- | * It's backward compatible with xfwm4 from Xfce 4.0, the PNG files are just ignored by xfwm4 4.0. | ||
- | |||
- | ===== Conclusion ===== | ||
- | I hope this small " | ||
- | |||
- | ===== Credits ===== | ||
- | This how-to has been started by Drewbian (drewbian at tsn dot cc) and later modifed by Olivier Fourdan (fourdan at xfce dot org). | ||