]> Pileus Git - ~andy/gtk/blob - tests/testgtkrc
Translation updated by Ivar Smolin.
[~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 }
35 class "GtkWidget" style "global-style-properties"
36
37 style "defaultfont"
38 {
39   font_name = "Sans 12"
40
41   Gtest::foo = 47
42   Gtest::bar = 47
43 #  GtkScrollbar::spacing = 33
44 #  GtkButton::color = { 3, 2,45, 6, 6, 4, 23 }
45 }
46
47 style "myicons"
48 {
49   stock["gtk-dialog-warning"] = 
50     { 
51       { "3DRings.xpm", *, *, *} 
52     }
53 }
54
55 class "GtkImage" style "myicons"
56
57 # common default
58 class "GtkWidget" style "defaultfont"
59
60 style "window"
61 {
62 # bg_pixmap[NORMAL] = "marble.xpm"
63 }
64
65 style "scale"
66 {
67   fg[NORMAL] = { 1.0, 0, 0 }
68   bg_pixmap[NORMAL] = "<parent>"
69 }
70
71 style "button" = "default"
72 {
73 #  fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
74 #  bg[PRELIGHT] = { 0, 0, 0.75 }
75 #  bg[PRELIGHT] = { 0.75, 0, 0x00 }
76 }
77
78 style "toggle_button" = "button"
79 {
80   fg[NORMAL] = { 1.0, 0, 0 }
81   fg[ACTIVE] = { 1.0, 0, 0 }
82 #  bg_pixmap[ACTIVE] = "check-y.xpm"
83 #  bg_pixmap[NORMAL] = "check-n.xpm"
84 }
85
86 style "text"
87 {
88   bg_pixmap[NORMAL] = "marble.xpm"
89   text[NORMAL] = { 1.0, 1.0, 1.0 }
90   fg[NORMAL] = { 1.0, 1.0, 1.0 }
91   base[NORMAL] = { 0.0, 0.0, 0.0 }
92 }
93
94 style "slider"
95 {
96   fg[NORMAL] = { 1.0, 1.0, 1.0 }
97   bg[NORMAL] = { 0.0, 0.0, 1.0 }
98   bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
99   bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
100 }
101
102 style "ruler"
103 {
104   font_name = 'Sans 8'
105 }
106
107 style "curve"
108 {
109   fg[NORMAL] = { 58000, 0, 0 }                  # red
110 }
111
112 style "red-bar-parent"
113 {
114   color["my-red"] = "red"
115   color["my-other-red"] = { 0.95, .55, 0.55 }
116 }
117
118 style "red-bar" = "red-bar-parent"
119 {
120   color["my-light-red"] = lighter (lighter (@my-red))
121
122   bg[PRELIGHT] = @my-light-red
123 }
124
125 # override testgtk2, introduce the green color in the button list
126 style 'button_list' = 'button'
127 {
128   font_name = "Monospace 10"
129   bg[PRELIGHT] = { 0, 0.75, 0x00 }
130 }
131 widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
132
133 style "checkbutton" {
134 #  GtkCheckButton::indicator-size = 27
135 }
136
137 class "GtkCheckButton" style "checkbutton"
138
139
140 class "GtkScrollbar" style "red-bar"
141
142 widget_class "GtkWindow" style "window"
143 widget_class "GtkDialog" style "window"
144 widget_class "GtkFileSelection" style "window"
145 widget_class "*Gtk*Scale" style "scale"
146 widget_class "*GtkCheckButton*" style "toggle_button"
147 widget_class "*GtkRadioButton*" style "toggle_button"
148 widget_class "*GtkButton*" style "button"
149 widget_class "*Ruler" style "ruler"
150 widget_class "*GtkText" style "text"
151 widget "*GtkCurve" style "curve"
152
153 binding "test1"
154 {
155   bind "<ctrl>1" {
156     "debug-msg" ("jup!")
157   }
158 }
159
160 binding "test2"
161 {
162   bind "<ctrl>1" {
163     "debug-msg" ("hallo and")
164     "debug-msg" ("huhu")
165   }
166 }
167
168 # possible priorities are (in ascending order):
169 # lowest
170 # gtk         (used by gtk for internal class bindings)
171 # application (for hard coded bindings on application basis)
172 # rc          (used implicitel by rc files)
173 # highest
174 class "GtkCList" binding  "test1"           # implicit : rc
175 #class "GtkWindow" binding : highest "test2" # override "rc" priority
176
177 binding "clist-test"
178 {
179   bind "j" {
180     "scroll-vertical" (step-backward, 0.0)
181   }
182   bind "k" {
183     "scroll-vertical" (step-forward, 0.0)
184   }
185 }
186
187 class "GtkCList" binding "clist-test"
188
189 style "testthickness" {
190   xthickness = 15
191   ythickness = 15
192 }
193
194 #class "GtkFrame" style "testthickness"
195
196 # Test ordering of RC file priorities
197
198 style "testgtk-red-style" {
199   fg[NORMAL] = "red"
200 }
201
202 style "testgtk-green-style" {
203   fg[NORMAL] = "green"
204 }
205
206 style "testgtk-blue-style" {
207  fg[NORMAL] = "blue"
208 }
209
210
211 widget_class "*.GtkAspectFrame.*.GtkLabel" style "testgtk-green-style"
212 widget_class "*.GtkAspectFrame.*.GtkLabel" style "testgtk-blue-style"  # override because it's later
213
214 widget "*.testgtk-red-label" style "testgtk-red-style"  # override because it's widget, not widget_class
215
216 widget "*.testgtk-green-label" style : highest "testgtk-green-style"
217 # overrides the following, because it is higher priority
218 widget "*.testgtk-green-label" style "testgtk-red-style"