Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
zh-cn:howto:xfwm4_theme [2012/04/29 03:59] – created haobug | zh-cn:howto:xfwm4_theme [2013/04/21 11:29] – [GTK 颜色 pickup] haobug | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Xfwm4 theme how-to ====== | + | ====== Xfwm4 主题 |
- | ===== Introduction | + | ===== 介绍 |
- | Xfwm4, Xfce4' | + | |
- | {{ howto: | + | Xfwm4 是 Xfce4 的原生的窗口管理器,它使用一种简单而灵活基于像素图的主题引擎,使用 |
- | ===== Themes locations ===== | + | {{ howto:xfwm4: |
- | In Xfwm4 version 4.0, the themes are searched in the following directories: | + | |
- | * User's home dir / | + | ===== 主题的存放位置 ===== |
- | * System' | + | |
- | In Xfwm version | + | 在 Xfwm4 版本 |
- | * User's home dir / | + | * 用户主目录/.themes/xfwm4/theme_name(例如: '' |
- | * System' | + | * 系统共享数据目录/xfwm4/theme_name(例如: '' |
+ | 在 Xfwm 版本 4.2 中,主题的存放位置是符合标准的,在下列目录搜索: | ||
+ | * 用户主目录/ | ||
+ | * 系统共享数据目录/ | ||
- | ===== 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: | + | 对于标题栏的修饰,xfwm4 使用 5 张名为 title-1-active.xpm 到 title-5-active.xpm 的像素图以及 top-left-active.xpm 和 top-right-active.xpm 组成两端的角如下图所示。 |
- | Pixmaps of a xfwm4 window | + | {{ howto:xfwm4:xfwm4-window-pixmaps.gif |图 2 - 构成整个窗口的像素图}} |
- | 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). | + | 非激活 xfwm4 窗口像素图使用一样的命名约定,只是单词换为 inactive;例如,title-1-inactive.xpm。 |
+ | 标题文字的颜色和阴影选项,对齐方式等在 themerc 文件中设置(在 themerc 小节详述)。 | ||
+ | ===== 窗口侧边和底部 ===== | ||
- | ===== 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 | + | |
- | The Window bottom grab bar is made up of bottom-active.xpm | + | 窗口底部的控制条由 |
- | 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. | + | ===== Xfwm4 按钮 ===== |
- | Buttons have active | + | xfwm4 最多可以使用 6 种动作按钮 —— stick(sticky 窗口),菜单,折叠,隐藏,最大化和关闭。 |
- | AbiWord Image menu-active.gif | + | |
- | ^ Figure | + | 按钮有激活的((获得焦点))或者非激活((失去焦点))和按下三种状态。如图 3 所示: |
+ | AbiWord 图片 menu-active.gif AbiWord 图片 menu-inactive.gif AbiWord 图片 image_2.gif | ||
+ | ^ 图 3 - Xfwm4 按钮状态 | ||
| {{howto: | | {{howto: | ||
- | Xfwm4 can also used " | + | Xfwm4 也使用'' |
- | AbiWord | + | |
- | ^ Figure | + | ^ 图 4 - 带额外切换按钮的粘附按钮 |
- | | {{howto: | + | | |
- | ===== Themerc file ===== | + | ===== themerc 文件 |
- | To set features such as title text colors, " | + | xfwm4 使用 '' |
- | ==== Button layout | + | ==== 按钮布局 |
- | It is also possible to " | + | |
+ | 也可以为特定主题定义'' | ||
# button_layout : | # button_layout : | ||
# O = Option menu | # O = Option menu | ||
Line 73: | Line 71: | ||
button_layout=OTS|HMC | button_layout=OTS|HMC | ||
- | A working example of this is the "B5" theme which only uses the close button. i.e. the entry "button_layout=C|" in the themerc file. | + | 现实的例子是,'' |
- | ==== Title width ==== | + | ==== 标题宽度 |
- | Another setting that needs to be set from the " | + | |
- | When set to "true", the center pixmap is repeated so that it fills the entire window width : | + | 另外一个需要在 '' |
+ | |||
+ | 当设置为 '' | ||
{{ howto: | {{ howto: | ||
- | When set to "false", the center pixmap is repeated | + | 当设置为 '' |
{{ howto: | {{ howto: | ||
- | ==== Text shadow | + | ==== 文本阴影 |
- | A shadow can be added to the title text by setting the boolean value " | + | |
- | Possible values are " | + | 通过设置 '' |
- | ==== 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_horizontal_offset | ||
Line 99: | Line 100: | ||
* title_vertical_offset_inactive | * title_vertical_offset_inactive | ||
- | ==== Button offset and spacing ==== | ||
- | Simlilarily, | ||
- | The "button_spacing" value gives the number of pixels between each button. | + | ==== 按钮偏移和间距 ==== |
+ | 同样地,可以通过使用“按钮偏移量”设置按钮的水平移动。这没有什么用,偏移值是相对的应用程序窗口的边框的,而不是 frame 边框。 | ||
+ | |||
+ | '' | ||
+ | ===== GTK 颜色 pickup ==== | ||
+ | 你肯定已经注意到,当使用安装 xfwm4 的默认主题,主题可以 “pick-up” GTK 主题颜色。不只是运行 GIMP 然后画按钮。大多数主题使用颜色符号表。这意味着 xpm 文件,必须能手工打开编辑。 | ||
+ | |||
+ | 颜色符号表如下: | ||
+ | ^ 名称 ^ 描述 ^ | ||
+ | | active_text_color | 激活窗口的标题文本颜色 | | ||
+ | | inactive_text_color | 非激活窗口的标题文本颜色 | | ||
+ | | active_border_color | 很少使用,一般设置为黑色 | | ||
+ | | inactive_border_color | 同上 | | ||
+ | | active_color_1 | 激活标题的背景颜色 | | ||
+ | | active_color_2 | 激活窗口的背景颜色 | | ||
+ | | active_hilight_1 | 激活标题的浅颜色,表现 3D 样式 | | ||
+ | | active_hilight_2 | 激活窗口的浅颜色 | | ||
+ | | active_mid_1 | 激活标题的深一点的颜色 | | ||
+ | | active_mid_2 | 激活窗口的深一点的颜色 | | ||
+ | | active_shadow_1 | 激活标题的深颜色,表现 3D 样式 | | ||
+ | | active_shadow_2 | 激活窗口的深颜色 | | ||
+ | | inactive_color_1 | 非激活标题的背景颜色| | ||
+ | | inactive_color_2 | 非激活窗口的背景颜色 | | ||
+ | | inactive_hilight_1 | 非激活标题的浅颜色,表现 3D 样式 | | ||
+ | | inactive_hilight_2 | 非激活窗口的浅颜色 | | ||
+ | | inactive_mid_1 | 非激活标题的深一点的颜色 | | ||
+ | | inactive_mid_2 | 非激活窗口的深一点的颜色 | | ||
+ | | inactive_shadow_1 | 非激活标题的深颜色,表现 3D 样式 | | ||
+ | | inactive_shadow_2 | 非激活窗口的深颜色 | | ||
- | ===== Gtk Color pickup ==== | + | 这些符号在运行时被实际的色彩值替换,窗口的边框自动继承 GTK 主题的颜色。 |
- | As you have no doubt noticed when using Xfwm4' | + | 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_color_2 | Background color for active window | | ||
- | | active_hilight_1 | Lighter color for active title for 3D look | | ||
- | | active_hilight_2 | Lighter color for active window | | ||
- | | active_mid_1 | Slightly darker color for active title | | ||
- | | active_mid_2 | Slightly darker color for active window | | ||
- | | active_shadow_1 | Darker color for active title for 3D look | | ||
- | | active_shadow_2 | Darker color for active window | | ||
- | | inactive_color_1 | Background color for inactive title | | ||
- | | inactive_color_2 | Background color for inactive window | | ||
- | | inactive_hilight_1 | Lighter color for inactive title for 3D look | | ||
- | | inactive_hilight_2 | Lighter color for inactive window | | ||
- | | inactive_mid_1 | Slightly darker color for inactive title | | ||
- | | inactive_mid_2 | Slightly darker color for inactive window | | ||
- | | inactive_shadow_1 | Darker color for inactive title for 3D look | | ||
- | | inactive_shadow_2 | 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. ===== | ===== From Wikipedia, the free encyclopedia. ===== | ||
Line 256: | Line 259: | ||
===== Credits ===== | ===== 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). | This how-to has been started by Drewbian (drewbian at tsn dot cc) and later modifed by Olivier Fourdan (fourdan at xfce dot org). | ||
+ |