|
1 /* Customize any plain widget that is a child of a QMainWindow. */ |
|
2 QMainWindow > .QWidget { |
|
3 background-color: gainsboro; |
|
4 background-image: url(images/pagefold.png); |
|
5 background-position: top right; |
|
6 background-repeat: no-repeat |
|
7 } |
|
8 |
|
9 /* Provide a padding for the layout inside the frame. The frame |
|
10 exists only to provide a padding for the top-right image, so we |
|
11 explicitly disable the border. */ |
|
12 #mainFrame { |
|
13 padding-right: 30px; |
|
14 border-style: none; |
|
15 border-image: none; /* since we set a border-image below */ |
|
16 } |
|
17 |
|
18 /* mainFrame won't have this border-image since we have |
|
19 explicitly set it to 'none' using a more specific selector. */ |
|
20 QFrame, QLineEdit, QComboBox[editable="true"], QSpinBox { |
|
21 border-image: url(images/frame.png) 4; |
|
22 border-width: 3; |
|
23 } |
|
24 |
|
25 QLabel { |
|
26 border: none; |
|
27 border-image: none; |
|
28 padding: 0; |
|
29 background: none; |
|
30 } |
|
31 |
|
32 |
|
33 /* Make text in message boxes selectable. */ |
|
34 QMessageBox { |
|
35 /* LinksAccessibleByMouse | TextSelectableByMouse */ |
|
36 messagebox-text-interaction-flags: 5; |
|
37 } |
|
38 |
|
39 /* Set the selection colors for all widgets. */ |
|
40 QWidget { |
|
41 selection-color: black; |
|
42 selection-background-color: Silver; |
|
43 color: black; |
|
44 } |
|
45 |
|
46 /* Make the entire row selected in item views. */ |
|
47 QAbstractItemView { |
|
48 show-decoration-selected: 1; |
|
49 } |
|
50 |
|
51 /* Nice WindowsXP-style password character for password line edits. */ |
|
52 QLineEdit[echoMode="2"] { |
|
53 lineedit-password-character: 9679; |
|
54 } |
|
55 |
|
56 /* Customize tooltips. */ |
|
57 QToolTip { |
|
58 background-color: rgb(200,200,255); |
|
59 border-color: darkslategray; |
|
60 border-width: 1px; |
|
61 border-style: solid; |
|
62 padding: 3px; |
|
63 font: bold; |
|
64 border-radius: 3px; |
|
65 opacity: 200; |
|
66 } |
|
67 |
|
68 /* Customize radio buttons. */ |
|
69 |
|
70 QRadioButton { |
|
71 spacing: 5px; |
|
72 } |
|
73 |
|
74 QRadioButton::indicator { |
|
75 width: 13px; |
|
76 height: 13px; |
|
77 } |
|
78 |
|
79 QRadioButton::indicator::unchecked { |
|
80 image: url(images/radiobutton_unchecked.png); |
|
81 } |
|
82 |
|
83 QRadioButton::indicator:unchecked:hover { |
|
84 image: url(images/radiobutton_unchecked_hover.png); |
|
85 } |
|
86 |
|
87 QRadioButton::indicator:unchecked:pressed { |
|
88 image: url(images/radiobutton_unchecked_pressed.png); |
|
89 } |
|
90 |
|
91 QRadioButton::indicator::checked { |
|
92 image: url(images/radiobutton_checked.png); |
|
93 } |
|
94 |
|
95 QRadioButton::indicator:checked:hover { |
|
96 image: url(images/radiobutton_checked_hover.png); |
|
97 } |
|
98 |
|
99 QRadioButton::indicator:checked:pressed { |
|
100 image: url(images/radiobutton_checked_pressed.png); |
|
101 } |
|
102 |
|
103 /* Customize arrows. */ |
|
104 |
|
105 *::down-arrow, *::menu-indicator { |
|
106 image: url(images/down_arrow.png); |
|
107 width: 7px; |
|
108 height: 7px; |
|
109 } |
|
110 |
|
111 *::down-arrow:disabled, *::down-arrow:off { |
|
112 image: url(images/down_arrow_disabled.png); |
|
113 } |
|
114 |
|
115 *::up-arrow { |
|
116 image: url(images/up_arrow.png); |
|
117 width: 7px; |
|
118 height: 7px; |
|
119 } |
|
120 |
|
121 *::up-arrow:disabled, *::up-arrow:off { |
|
122 image: url(images/up_arrow_disabled.png); |
|
123 } |
|
124 |
|
125 /* Customize push buttons and comboboxes. Our read-only combobox |
|
126 is very similar to a push button, so they share the same border image. */ |
|
127 |
|
128 QPushButton { |
|
129 min-width: 4em; |
|
130 } |
|
131 |
|
132 QPushButton, QComboBox[editable="false"], |
|
133 QComboBox[editable="true"]::drop-down { |
|
134 border-image: url(images/pushbutton.png) 5; |
|
135 border-width: 5; |
|
136 } |
|
137 |
|
138 QPushButton:hover, QComboBox[editable="false"]:hover, |
|
139 QComboBox[editable="true"]::drop-down:hover, QMenuBar::item:hover { |
|
140 border-image: url(images/pushbutton_hover.png) 5; |
|
141 border-width: 5; |
|
142 } |
|
143 |
|
144 QPushButton:pressed, QComboBox[editable="false"]:on, |
|
145 QComboBox[editable="true"]::drop-down:on, QMenuBar::item:on { |
|
146 border-image: url(images/pushbutton_pressed.png) 5; |
|
147 border-width: 5; |
|
148 } |
|
149 |
|
150 /* Customize read-only comboboxes. */ |
|
151 |
|
152 QComboBox[editable="false"] { |
|
153 padding-left: 3px; |
|
154 padding-right: 20px; /* space for the arrow */ |
|
155 } |
|
156 |
|
157 QComboBox[editable="false"]::drop-down { |
|
158 subcontrol-origin: padding; |
|
159 subcontrol-position: top right; |
|
160 width: 15px; |
|
161 border-left-style: solid; |
|
162 border-left-color: darkgray; |
|
163 border-left-width: 1px; |
|
164 } |
|
165 |
|
166 QComboBox[editable="false"]::down-arrow { |
|
167 subcontrol-origin: content; |
|
168 subcontrol-position: center; |
|
169 position: relative; |
|
170 left: 1px; /* 1 pixel dropdown border */ |
|
171 } |
|
172 |
|
173 /* The combobox arrow is on when the popup is open. */ |
|
174 QComboBox[editable="false"]::down-arrow:on { |
|
175 position: relative; |
|
176 top: 1px; |
|
177 left: 2px; |
|
178 } |
|
179 |
|
180 /* Customize editable comboboxes. */ |
|
181 |
|
182 QComboBox[editable="true"] { |
|
183 padding-right: 16px; |
|
184 } |
|
185 |
|
186 QComboBox[editable="true"]::drop-down { |
|
187 subcontrol-origin: border; |
|
188 subcontrol-position: top right; |
|
189 width: 13px; |
|
190 position: absolute; |
|
191 top: 2px; |
|
192 bottom: 2px; |
|
193 right: 2px; |
|
194 } |
|
195 |
|
196 QComboBox[editable="true"]::drop-down, |
|
197 QComboBox[editable="true"]::drop-down:hover, |
|
198 QComboBox[editable="true"]::drop-down:on { |
|
199 border-width: 0px; |
|
200 border-left-width: 3px; /* we need only left and center part */ |
|
201 } |
|
202 |
|
203 /* Shift the arrow when it's open. */ |
|
204 QComboBox[editable="true"]::down-arrow:on { |
|
205 position: relative; |
|
206 top: 1px; |
|
207 left: 1px; |
|
208 } |
|
209 |
|
210 /* Customize check boxes. */ |
|
211 QCheckBox { |
|
212 spacing: 5px; |
|
213 } |
|
214 |
|
215 QCheckBox::indicator { |
|
216 width: 13px; |
|
217 height: 13px; |
|
218 } |
|
219 |
|
220 QCheckBox::indicator:unchecked { |
|
221 image: url(images/checkbox_unchecked.png); |
|
222 } |
|
223 |
|
224 QCheckBox::indicator:unchecked:hover { |
|
225 image: url(images/checkbox_unchecked_hover.png); |
|
226 } |
|
227 |
|
228 QCheckBox::indicator:unchecked:pressed { |
|
229 image: url(images/checkbox_unchecked_pressed.png); |
|
230 } |
|
231 |
|
232 QCheckBox::indicator:checked { |
|
233 image: url(images/checkbox_checked.png); |
|
234 } |
|
235 |
|
236 QCheckBox::indicator:checked:hover { |
|
237 image: url(images/checkbox_checked_hover.png); |
|
238 } |
|
239 |
|
240 QCheckBox::indicator:checked:pressed { |
|
241 image: url(images/checkbox_checked_pressed.png); |
|
242 } |
|
243 |
|
244 /* Customize the size grip. */ |
|
245 QSizeGrip { |
|
246 image: url(images/sizegrip.png); |
|
247 width: 16px; |
|
248 height: 16px; |
|
249 } |
|
250 |
|
251 /* Customize the menu bar. */ |
|
252 QMenuBar { |
|
253 border-image: none; |
|
254 border-style: none; |
|
255 border-width: 1px; |
|
256 border-bottom-style: solid; |
|
257 border-bottom-color: darkslategray; |
|
258 padding: 2px; |
|
259 } |
|
260 |
|
261 /* Customize spin boxes. */ |
|
262 |
|
263 QSpinBox { |
|
264 padding-right: 15px; |
|
265 } |
|
266 |
|
267 QSpinBox::up-button { |
|
268 subcontrol-origin: border; |
|
269 subcontrol-position: top right; |
|
270 |
|
271 width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */ |
|
272 border-image: url(images/spinup.png) 1; |
|
273 border-width: 1px; |
|
274 } |
|
275 |
|
276 QSpinBox::up-button:hover { |
|
277 border-image: url(images/spinup_hover.png) 1; |
|
278 } |
|
279 |
|
280 QSpinBox::up-button:pressed { |
|
281 border-image: url(images/spinup_pressed.png) 1; |
|
282 } |
|
283 |
|
284 QSpinBox::down-button { |
|
285 subcontrol-origin: border; |
|
286 subcontrol-position: bottom right; |
|
287 |
|
288 width: 16px; |
|
289 border-image: url(images/spindown.png) 1; |
|
290 border-width: 1px; |
|
291 border-top-width: 0; |
|
292 } |
|
293 |
|
294 QSpinBox::down-button:hover { |
|
295 border-image: url(images/spindown_hover.png) 1; |
|
296 } |
|
297 |
|
298 QSpinBox::down-button:pressed { |
|
299 border-image: url(images/spindown_pressed.png) 1; |
|
300 } |
|
301 |