]> Pileus Git - ~andy/gtk/blob - tests/testgtkrc
Updated Traditional Chinese translation (Hong Kong and Taiwan)
[~andy/gtk] / tests / testgtkrc
1 # pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
2 #
3 # include "rc-file"
4 #
5 # style <name> [= <name>]
6 # {
7 #   <option>
8 # }
9 #
10 # widget <widget_set> style <style_name>
11 # widget_class <widget_class_set> style <style_name>
12
13 # testgtkrc2 sets all the buttons in the main window to blue by default
14 include "testgtkrc2"
15
16 double-click_timeout = 42
17 bell-duration = 39
18 bell_duration = 40
19
20 # gtk-cursor-blink-time = 200
21 # gtk-menu-bar-accel = F10
22
23 style "global-style-properties"
24 {
25 #  xthickness = 20
26   GtkButton::child_displacement_x = 1
27   GtkButton::child_displacement_y = 1
28 #  GtkWidget::cursor_color = "#ff0000"
29   GtkToolbar::space_size = 10
30   GtkToolbar::space_style = line
31   GtkToolbar::button_relief = none
32   GtkButtonBox::child_min_width = 0
33   GtkButtonBox::child_min_height = 0
34   GtkArrow::arrow-scaling = 1.0
35   GtkEntry::invisible-char = 10046
36 }
37
38 class "GtkWidget" style "global-style-properties"
39
40 style "defaultfont"
41 {
42   font_name = "Sans 12"
43
44   Gtest::foo = 47
45   Gtest::bar = 47
46 #  GtkScrollbar::spacing = 33
47 #  GtkButton::color = { 3, 2,45, 6, 6, 4, 23 }
48 }
49
50 style "myicons"
51 {
52   stock["gtk-dialog-warning"] = 
53     { 
54       { "3DRings.xpm", *, *, *} 
55     }
56 }
57
58 class "GtkImage" style "myicons"
59
60 # common default
61 class "GtkWidget" style "defaultfont"
62
63 style "window"
64 {
65 # bg_pixmap[NORMAL] = "marble.xpm"
66 }
67
68 style "scale"
69 {
70   fg[NORMAL] = { 1.0, 0, 0 }
71   bg_pixmap[NORMAL] = "<parent>"
72 }
73
74 style "button" = "default"
75 {
76 #  fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
77 #  bg[PRELIGHT] = { 0, 0, 0.75 }
78 #  bg[PRELIGHT] = { 0.75, 0, 0x00 }
79 }
80
81 style "label" = "default"
82 {
83  base[PRELIGHT] = "gray"
84  base[ACTIVE] = mix (0.9, "gray", "purple")
85 }
86
87 class "GtkLabel" style "label"
88
89 style "toggle_button" = "button"
90 {
91   fg[NORMAL] = { 1.0, 0, 0 }
92   fg[ACTIVE] = { 1.0, 0, 0 }
93 #  bg_pixmap[ACTIVE] = "check-y.xpm"
94 #  bg_pixmap[NORMAL] = "check-n.xpm"
95 }
96
97 style "text"
98 {
99   bg_pixmap[NORMAL] = "marble.xpm"
100   text[NORMAL] = { 1.0, 1.0, 1.0 }
101   fg[NORMAL] = { 1.0, 1.0, 1.0 }
102   base[NORMAL] = { 0.0, 0.0, 0.0 }
103 }
104
105 style "slider"
106 {
107   fg[NORMAL] = { 1.0, 1.0, 1.0 }
108   bg[NORMAL] = { 0.0, 0.0, 1.0 }
109   bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
110   bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
111 }
112
113 style "ruler"
114 {
115   font_name = 'Sans 8'
116 }
117
118 style "curve"
119 {
120   fg[NORMAL] = { 58000, 0, 0 }                  # red
121 }
122
123 style "red-bar-parent"
124 {
125   color["my-red"] = "red"
126   color["my-other-red"] = { 0.95, .55, 0.55 }
127 }
128
129 style "red-bar" = "red-bar-parent"
130 {
131   color["my-light-red"] = lighter (lighter (@my-red))
132
133   bg[PRELIGHT] = @my-light-red
134 }
135
136 # override testgtk2, introduce the green color in the button list
137 style 'button_list' = 'button'
138 {
139   font_name = "Monospace 10"
140   bg[PRELIGHT] = { 0, 0.75, 0x00 }
141 }
142 widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
143
144 style "checkbutton" {
145 #  GtkCheckButton::indicator-size = 27
146 }
147
148 class "GtkCheckButton" style "checkbutton"
149
150
151 class "GtkScrollbar" style "red-bar"
152
153 widget_class "GtkWindow" style "window"
154 widget_class "GtkDialog" style "window"
155 widget_class "GtkFileSelection" style "window"
156 widget_class "*Gtk*Scale" style "scale"
157 widget_class "*GtkCheckButton*" style "toggle_button"
158 widget_class "*GtkRadioButton*" style "toggle_button"
159 widget_class "*GtkButton*" style "button"
160 widget_class "*Ruler" style "ruler"
161 widget_class "*GtkText" style "text"
162
163 binding "test1"
164 {
165   bind "<ctrl>1" {
166     "debug-msg" ("jup!")
167   }
168 }
169
170 binding "test2"
171 {
172   bind "<ctrl>1" {
173     "debug-msg" ("hallo and")
174     "debug-msg" ("huhu")
175   }
176 }
177
178 # possible priorities are (in ascending order):
179 # lowest
180 # gtk         (used by gtk for internal class bindings)
181 # application (for hard coded bindings on application basis)
182 # rc          (used implicitel by rc files)
183 # highest
184 class "GtkCList" binding  "test1"           # implicit : rc
185 #class "GtkWindow" binding : highest "test2" # override "rc" priority
186
187 binding "clist-test"
188 {
189   bind "j" {
190     "scroll-vertical" (step-backward, 0.0)
191   }
192   bind "k" {
193     "scroll-vertical" (step-forward, 0.0)
194   }
195 }
196
197 class "GtkCList" binding "clist-test"
198
199 style "testthickness" {
200   xthickness = 15
201   ythickness = 15
202 }
203
204 #class "GtkFrame" style "testthickness"
205
206 # Test ordering of RC file priorities
207
208 style "testgtk-red-style" {
209   fg[NORMAL] = "red"
210 }
211
212 style "testgtk-green-style" {
213   fg[NORMAL] = "green"
214 }
215
216 style "testgtk-blue-style" {
217  fg[NORMAL] = "blue"
218 }
219
220
221 widget_class "*.GtkAspectFrame.*.GtkLabel" style "testgtk-green-style"
222 widget_class "*.GtkAspectFrame.*.GtkLabel" style "testgtk-blue-style"  # override because it's later
223
224 widget "*.testgtk-red-label" style "testgtk-red-style"  # override because it's widget, not widget_class
225
226 widget "*.testgtk-green-label" style : highest "testgtk-green-style"
227 # overrides the following, because it is higher priority
228 widget "*.testgtk-green-label" style "testgtk-red-style"