GTK主题创作指南
author: Tim Orford date: Jan 06作者: Tim Orford日期: Jan 06
Contents内容
introduction 简介
general widget properties 一般部件性能
gtkrc files gtkrc文件
widget examples 小工具的例子
fonts 字体
key bindings 键绑定
engines 发动机
icons 图标
cursors 游标
further reading 进一步阅读
general widget properties 一般部件性能
gtkrc files gtkrc文件
widget examples 小工具的例子
fonts 字体
key bindings 键绑定
engines 发动机
icons 图标
cursors 游标
further reading 进一步阅读
introduction:简介:
html实践之路视频课程
properties文件用什么打开Gtk programmers will tell you that writing a gtk theme is easy. gtk的程序员会告诉你,写一个GTK主题是容易的。 If you have a full understanding of how gtk is put together, then that may be so, but if you dont have an intimate knowledge of the gtk api and you want to change the visual appearance of your gtk apps then this document may hopefully save you some swearing while you go through the process of trial and error trying to figure out what works and what doesnt.如果你有一个这么全面了解了GTK是放在一起,那么这可能,但如果你没有一个熟悉的GTK的API的,你要改变你的GTK应用程序外观特征那么这个文件可能希望为您节省一些脏话,而你经过审讯过程中的错误,并试图出什么可行,什么doesn't。 Its not difficult stuff, but can appear to be somewhat random and non-intuitive due to its close correlation with the underlying widget structure.它的东西并不难,但可以显得有些随机和非直观的部件,由于其结构与基础密切相关。
This document applies only to Gtk2, although Gtk1.2 themes are quite similar.本文件仅适用于与gtk2,虽然Gtk1.2主题非常相似。
Warning: this document is incomplete. The tutorial may be useful.警告:本文件是不完整的。 教程可能是有用的。
theme browsing主题浏览
LXAppearance is a great new tool for browsing gtk and icon themes. Also good are gtk-chtheme , and the older and slightly buggy gtk-theme-switch . LXAppearance是一个伟大的图标主题的新工具GTK和浏览。还不错是gtk的chtheme ,以及老年人和稍微有些错误的GTK主题开关 。
general widget properties:一般部件属性:
There are several 'directives' to change the attributes of a widget.有几个'指示'来改变一个组件的属性。
∙ fg - Sets the foreground color of a widget. fg - 设置构件的前景。
∙ bg - Sets the background color of a widget. 084 - 设置构件的背景颜。
∙ text - Sets the foreground color for widgets that have editable text.文本 - 设置有可编辑的文本控件的前景。
∙ base - Sets the background color for widgets that have editable text.基地 - 设置有可编辑的文本控件的背景颜。
∙ bg_pixmap - Sets the background of a widget to a tiled pixmap. bg_pixmap - 设置构件的背景平铺的pixmap。
∙ font_name - Sets the font to be used with the given widget. font_name -设置要使用的字体与给定的部件。
∙ xthickness - Sets the left and right border width. xthickness - 设置左右边框的宽度。 This is not what you might think; it sets the borders of children(?)这不是你可能会认为,它集儿童的边界(?)
∙ ythickness - similar to above but for the top and bottom. ythickness - 类似的条件,但在顶部和底部。
There are several states a widget can be in, and you can set different colors, pixmaps and fonts for each state.有几个州的一个小部件可在,你可以为每个国家不同的颜,像
素映射和字体。 These states are:这些国家是:
∙ NORMAL - The normal state of a widget.普通 - 构件的正常状态。 Ie the mouse is not over it, and it is not being pressed, etc.即鼠标还没有结束它,它没有被按下,等
∙ PRELIGHT - When the mouse is over top of the widget, colors defined using this state will be in effect. PRELIGHT - 当鼠标在widget的顶部,颜来定义这种状态将生效。
∙ ACTIVE - When the widget is pressed or clicked it will be active, and the attributes assigned by this tag will be in effect.主动 - 当构件被按下或点击它会被激活,并通过这个标签的属性分配将生效。
∙ INSENSITIVE - This is the state when a widget is 'greyed out'.不敏感 - 这是一个部件时的状态是'灰'。 It is not active, and cannot be clicked on.它不活跃,无法点击。
∙ SELECTED - When an object is selected, it takes these attributes.选 - 当一个对象被选中,它需要这些属性。
gtkrc files: gtkrc文件:
file location 文件的位置
rc files are named "gtkrc" and may be located in many places depending on how the system is configured. rc文件被命名为“gtkrccodeblocks不到gcc编译器”,可在具体取决于系统的配置位于很多地方。 There will usually be a global repository somewhere such as /usr/share/themes/ where gtkrc files are contained within a subdirectory named after the theme.通常会有一个全球信息库的地方,比如/ usr /共享/主题/其中gtkrc文件命名后的主题包含的子目录内。 There is often a ~/.gtk-2.0/gtkrc file which may be either an rc file, a link to an rc file, or a stub containing an include of another gtkrc file.往往有一个〜/ .gtk-2.0/gtkrc文件,该文件可能是一个RC文件,一个文件链接到一个RC,或存根文件包括载有另一gtkrc。
rc files are named "gtkrc" and may be located in many places depending on how the system is configured. rc文件被命名为“gtkrccodeblocks不到gcc编译器”,可在具体取决于系统的配置位于很多地方。 There will usually be a global repository somewhere such as /usr/share/themes/ where gtkrc files are contained within a subdirectory named after the theme.通常会有一个全球信息库的地方,比如/ usr /共享/主题/其中gtkrc文件命名后的主题包含的子目录内。 There is often a ~/.gtk-2.0/gtkrc file which may be either an rc file, a link to an rc file, or a stub containing an include of another gtkrc file.往往有一个〜/ .gtk-2.0/gtkrc文件,该文件可能是一个RC文件,一个文件链接到一个RC,或存根文件包括载有另一gtkrc。
colours: 颜:
colours can be specified in several different ways:颜可以指定在几个不同的方式:
-by name: Gtk knows all names from the X color database /usr/lib/按名称:从X的Gtk知道颜数据库/ usr/lib/所有的名字
eg "red"如“红”
-one of the hexadecimal forms "#rrrrggggbbbb", "#rrrgggbbb", "#rrggbb" , or "#rgb" , wherstring index out of range啥意思
colours can be specified in several different ways:颜可以指定在几个不同的方式:
-by name: Gtk knows all names from the X color database /usr/lib/按名称:从X的Gtk知道颜数据库/ usr/lib/所有的名字
eg "red"如“红”
-one of the hexadecimal forms "#rrrrggggbbbb", "#rrrgggbbb", "#rrggbb" , or "#rgb" , wherstring index out of range啥意思
e r, g and b are hex digits.一十六进制形式"#rrrrggggbbbb", "#rrrgggbbb", "#rrggbb"或渐变美甲款式图片"#rgb" ,其中R,G和B是十六进制数字。 They must be in quotes.他们必须加引号。
-as a triplet { r, g, b} , where r, g and b are either integers in the range 0-65635 or floats in the range 0.0-1.0.作为一个三重{ r, g, b} ,其中R,G和B是不是整数,范围0-65635的或浮在0.0-1.0范围内。
eg {1.00, 0.00, 0.00} for red.例如: {1.00, 0.00, 0.00}为红。
-as a triplet { r, g, b} , where r, g and b are either integers in the range 0-65635 or floats in the range 0.0-1.0.作为一个三重{ r, g, b} ,其中R,G和B是不是整数,范围0-65635的或浮在0.0-1.0范围内。
eg {1.00, 0.00, 0.00} for red.例如: {1.00, 0.00, 0.00}为红。
Gtk 2.10 introduced the "gtk-color-scheme" property. gtk的2.10推出了“gtk的彩计划”的财产。 This contains a list of colours. gtk-color-scheme = "fg_color : white tooltip_bg_color: black" The meaning of the colour names is explained in /GnomeArt/Tutorials/GtkThemes/SymbolicColors. Apparently this setting doesnt work under all circumstances.这包含一个颜列表。 gtk-color-scheme = "fg_color : white tooltip_bg_color: black"的名称所指的颜是/GnomeArt/Tutorials/GtkThemes/SymbolicColors解释了。显然在任何情况下设置doesn't工作。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论