summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/stylesheet/qss/pagefold.qss
blob: 3701fc713cb44de740739b7776695bd6be19e414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/* Customize any plain widget that is a child of a QMainWindow. */
QMainWindow > .QWidget {
    background-color: gainsboro;
    background-image: url(:/images/pagefold.png);
    background-position: top right;
    background-repeat: no-repeat
}

/* Provide a padding for the layout inside the frame. The frame
   exists only to provide a padding for the top-right image, so we
   explicitly disable the border. */
#mainFrame {
    padding-right: 30px;
    border-style: none;
    border-image: none; /* since we set a border-image below */
}

/* mainFrame won't have this border-image since we have
   explicitly set it to 'none' using a more specific selector. */
QFrame, QLineEdit, QComboBox[editable="true"], QSpinBox {
    border-image: url(:/images/frame.png) 4;
    border-width: 3;
}

QLabel {
    border: none;
    border-image: none;
    padding: 0;
    background: none;
}

/* Make text in message boxes selectable. */
QMessageBox {
    /* LinksAccessibleByMouse | TextSelectableByMouse */
    messagebox-text-interaction-flags: 5;
}
   
/* Set the selection colors for all widgets. */
QWidget {
    selection-color: black;
    selection-background-color: Silver;
    color: black;
}

/* Make the entire row selected in item views. */
QAbstractItemView {
    show-decoration-selected: 1;
}

/* Nice WindowsXP-style password character for password line edits. */
QLineEdit[echoMode="2"] {
    lineedit-password-character: 9679;
}

/* Customize tooltips. */
QToolTip {
    background-color: rgb(200,200,255);
    border-color: darkslategray;
    border-width: 1px;
    border-style: solid;
    padding: 3px;
    font: bold;
    border-radius: 3px;
    opacity: 200;
}

/* Customize radio buttons. */

QRadioButton {
    spacing: 5px;
}

QRadioButton::indicator {
    width: 13px;
    height: 13px;
}

QRadioButton::indicator::unchecked {
    image: url(:/images/radiobutton_unchecked.png);
}

QRadioButton::indicator:unchecked:hover {
    image: url(:/images/radiobutton_unchecked_hover.png);
}

QRadioButton::indicator:unchecked:pressed {
    image: url(:/images/radiobutton_unchecked_pressed.png);
}

QRadioButton::indicator::checked {
    image: url(:/images/radiobutton_checked.png);
}

QRadioButton::indicator:checked:hover {
    image: url(:/images/radiobutton_checked_hover.png);
}

QRadioButton::indicator:checked:pressed {
    image: url(:/images/radiobutton_checked_pressed.png);
}

/* Customize arrows. */

*::down-arrow, *::menu-indicator {
    image: url(:/images/down_arrow.png);
    width: 7px;
    height: 7px;
}

*::down-arrow:disabled, *::down-arrow:off {
   image: url(:/images/down_arrow_disabled.png);
}

*::up-arrow {
    image: url(:/images/up_arrow.png);
    width: 7px;
    height: 7px;
}

*::up-arrow:disabled, *::up-arrow:off {
   image: url(:/images/up_arrow_disabled.png);
}

/* Customize push buttons and comboboxes. Our read-only combobox
   is very similar to a push button, so they share the same border image. */

QPushButton {
    min-width: 4em;
}

QPushButton, QComboBox[editable="false"],
QComboBox[editable="true"]::drop-down {
    border-image: url(:/images/pushbutton.png) 5;
    border-width: 5;
}

QPushButton:hover, QComboBox[editable="false"]:hover,
QComboBox[editable="true"]::drop-down:hover, QMenuBar::item:hover {
    border-image: url(:/images/pushbutton_hover.png) 5;
    border-width: 5;
}

QPushButton:pressed, QComboBox[editable="false"]:on,
QComboBox[editable="true"]::drop-down:on, QMenuBar::item:on {
    border-image: url(:/images/pushbutton_pressed.png) 5;
    border-width: 5;
}

/* Customize read-only comboboxes. */

QComboBox[editable="false"] {
    padding-left: 3px;
    padding-right: 20px; /* space for the arrow */
}

QComboBox[editable="false"]::drop-down {
    subcontrol-origin: padding;
    subcontrol-position: top right;
    width: 15px;
    border-left-style: solid;
    border-left-color: darkgray;
    border-left-width: 1px;
}

QComboBox[editable="false"]::down-arrow {
    subcontrol-origin: content;
    subcontrol-position: center;
    position: relative;
    left: 1px; /* 1 pixel dropdown border */
}

/* The combobox arrow is on when the popup is open. */
QComboBox[editable="false"]::down-arrow:on {
    position: relative;
    top: 1px;
    left: 2px;
}

/* Customize editable comboboxes. */

QComboBox[editable="true"] {
    padding-right: 16px;
}

QComboBox[editable="true"]::drop-down {
    subcontrol-origin: border;
    subcontrol-position: top right;
    width: 13px;
    position: absolute;
    top: 2px;
    bottom: 2px;
    right: 2px;
}

QComboBox[editable="true"]::drop-down,
QComboBox[editable="true"]::drop-down:hover,
QComboBox[editable="true"]::drop-down:on {
    border-width: 0px;  
    border-left-width: 3px; /* we need only left and center part */
}

/* Shift the arrow when it's open. */
QComboBox[editable="true"]::down-arrow:on {
    position: relative;
    top: 1px;
    left: 1px;
}

/* Customize check boxes. */
QCheckBox {
    spacing: 5px;
}

QCheckBox::indicator {
    width: 13px;
    height: 13px;
}

QCheckBox::indicator:unchecked {
    image: url(:/images/checkbox_unchecked.png);
}

QCheckBox::indicator:unchecked:hover {
    image: url(:/images/checkbox_unchecked_hover.png);
}

QCheckBox::indicator:unchecked:pressed {
    image: url(:/images/checkbox_unchecked_pressed.png);
}

QCheckBox::indicator:checked {
    image: url(:/images/checkbox_checked.png);
}

QCheckBox::indicator:checked:hover {
    image: url(:/images/checkbox_checked_hover.png);
}

QCheckBox::indicator:checked:pressed {
    image: url(:/images/checkbox_checked_pressed.png);
}

/* Customize the size grip. */
QSizeGrip {
    image: url(:/images/sizegrip.png);
    width: 16px;
    height: 16px;
}

/* Customize the menu bar. */
QMenuBar {
    border-image: none;
    border-style: none;
    border-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: darkslategray;
    padding: 2px;
}

/* Customize spin boxes. */

QSpinBox { 
    padding-right: 15px;
}

QSpinBox::up-button {
    subcontrol-origin: border;
    subcontrol-position: top right;

    width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
    border-image: url(:/images/spinup.png) 1;
    border-width: 1px;
}

QSpinBox::up-button:hover {
    border-image: url(:/images/spinup_hover.png) 1;
}

QSpinBox::up-button:pressed {
    border-image: url(:/images/spinup_pressed.png) 1;
}

QSpinBox::down-button {
    subcontrol-origin: border;
    subcontrol-position: bottom right;

    width: 16px;
    border-image: url(:/images/spindown.png) 1;
    border-width: 1px;
    border-top-width: 0;
}

QSpinBox::down-button:hover {
    border-image: url(:/images/spindown_hover.png) 1;
}

QSpinBox::down-button:pressed {
    border-image: url(:/images/spindown_pressed.png) 1;
}