Skip to content

Commit 1b460b5

Browse files
committedJan 1, 2019
Make Blend of Gray theme hidpi-compatible
1 parent 3599842 commit 1b460b5

File tree

1 file changed

+81
-51
lines changed

1 file changed

+81
-51
lines changed
 

‎resources/themes/Blend of Gray/style.qss

Lines changed: 81 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,30 @@ QMenuBar::item:pressed
4646
}
4747

4848
QAbstractSpinBox {
49-
padding: 3px 0px 3px 3px;
49+
padding: 0.1em 0em 0.1em 0.1em;
5050
border: 1px solid #222;
51-
border-radius:4px;
51+
border-radius: 0.2em;
5252
background-color: @darkgradient;
5353
color:@itembackground;
5454
}
5555

5656
QAbstractSpinBox::up-button {
5757
subcontrol-origin: border;
5858
subcontrol-position: top right;
59-
width: 16px;
59+
padding-top:-0.2em;
60+
padding-right:0.05em;
61+
width: 0.8em;
62+
height: 1.2em;
6063
image: url(@theme_path/icons/arrow-up.svg);
6164
}
6265

6366
QAbstractSpinBox::down-button {
6467
subcontrol-origin: border;
6568
subcontrol-position: bottom right;
66-
width: 16px;
69+
padding-top:0.2em;
70+
padding-right:0.05em;
71+
width: 0.8em;
72+
height: 1.2em;
6773
image: url(@theme_path/icons/arrow-down.svg);
6874
}
6975

@@ -76,21 +82,21 @@ QMenu
7682
{
7783
background: #444;
7884
border: 1px solid #222;
79-
padding: 4px;
80-
padding-right: 0px;
85+
padding: 0.2em;
86+
padding-right: 0em;
8187
}
8288

8389
QMenu::item
8490
{
8591
background: transparent;
86-
padding: 5px 20px 5px 20px;
92+
padding: 0.2em 1.3em 0.2em 1.3em;
8793
}
8894

8995
QMenu::item:disabled
9096
{
9197
color: #555;
9298
background: transparent;
93-
padding: 2px 20px 2px 20px;
99+
padding: 0.2em 1.3em 0.2em 1.3em;
94100
}
95101

96102

@@ -108,53 +114,53 @@ QWidget:disabled
108114

109115
QLineEdit, QTextEdit, QPlainTextEdit
110116
{
111-
padding: 3px;
117+
padding: 0.1em;
112118
border-width: 1px;
113119
border-color: @itemdarkbackground;
114120
border-style: solid;
115-
border-radius: 4px;
121+
border-radius: 0.2em;
116122
background-color:@itembackground;
117123
color:@text;
118124
}
119125

120126
QPushButton
121127
{
122-
padding: 3px;
128+
padding: 0.1em;
123129
border-width: 1px;
124130
border-color: @itemdarkbackground;
125131
border-style: solid;
126-
border-radius: 4px;
132+
border-radius: 0.2em;
127133
background-color:@itembackground;
128134
color:@text;
129135
}
130136

131137
QToolButton
132138
{
133-
padding: 2px;
139+
padding: 0.1em;
134140
border-width: 1px;
135141
border-color: @itemdarkbackground;
136142
border-style: solid;
137-
border-radius: 4px;
143+
border-radius: 0.2em;
138144
background-color:@itembackground;
139145
color:@text;
140146
}
141147
QToolButton[popupMode="1"]
142148
{
143-
padding-right: 18px;
149+
padding-right: 0.9em;
144150
}
145151
QToolButton::menu-button {
146-
width: 14px;
152+
width: 0.8em;
147153
border-width: 1px;
148154
border-color: none;
149-
border-radius: 4px;
155+
border-radius: 0.2em;
150156
background:@itemdarkbackground;
151157
}
152158
QToolButton::hover, QToolButton::menu-button::hover
153159
{
154160
border-width: 1px;
155161
border-color: #1e1e1e;
156162
border-style: solid;
157-
border-radius: 4px;
163+
border-radius: 0.2em;
158164
background-color: none;
159165
}
160166
QToolButton:checked
@@ -164,6 +170,8 @@ QToolButton:checked
164170
QToolButton::menu-arrow
165171
{
166172
image: url(@theme_path/icons/arrow-down.svg);
173+
width: 0.8em;
174+
height: 1.2em;
167175
}
168176
QToolBar QToolButton, QToolButton::menu-button
169177
{
@@ -180,9 +188,9 @@ QComboBox {
180188
background-color: @darkgradient;
181189
color:@itembackground;
182190
border-style: solid;
183-
border: 1px solid #1e1e1e;
184-
border-radius:4px;
185-
padding: 3px;
191+
border: 1px solid #1e1e1e;
192+
border-radius: 0.2em;
193+
padding: 0.1em;
186194
}
187195

188196

@@ -191,8 +199,8 @@ QComboBox:hover,QPushButton:hover,QToolButton:hover,QAbstractSpinBox:hover {
191199
}
192200

193201
QComboBox:on {
194-
padding-top: 1px;
195-
padding-left: 3px;
202+
padding: 0.1em;
203+
padding-left: 0.2em;
196204
background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
197205
stop: 0 #555,
198206
stop: 0.1 #4C4C4C,
@@ -213,7 +221,7 @@ QComboBox:editable QLineEdit {
213221
QComboBox QAbstractItemView, QComboBox QListView {
214222
border: none;
215223
border-radius: 0;
216-
padding: 3px;
224+
padding: 0.1em;
217225
background: @itemdarkbackground;
218226
color: @itembackground;
219227
selection-background-color: @selection;
@@ -222,13 +230,15 @@ QComboBox QAbstractItemView, QComboBox QListView {
222230
QComboBox::drop-down {
223231
subcontrol-origin: padding;
224232
subcontrol-position: top right;
225-
width: 15px;
233+
width: 0.8em;
226234
border: 0px;
227235
}
228236

229237
QComboBox::down-arrow
230238
{
231239
image: url(@theme_path/icons/arrow-down.svg);
240+
width: 0.8em;
241+
height: 1.2em;
232242
}
233243

234244

@@ -249,7 +259,7 @@ QTextEdit:focus
249259

250260
QScrollBar:horizontal {
251261
background-color: #333;
252-
height: 8px;
262+
height: 0.5em;
253263
margin: 0px;
254264
padding: 0px;
255265
}
@@ -267,7 +277,7 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
267277

268278
QScrollBar:vertical {
269279
background-color: #333;
270-
width: 8px;
280+
width: 0.5em;
271281
margin: 0;
272282
}
273283

@@ -285,14 +295,14 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
285295

286296
QSizeGrip
287297
{
288-
width: 1px;
298+
width: 0.1em;
289299
}
290300

291301
QHeaderView::section
292302
{
293303
/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565);*/
294304
color: @text;
295-
padding-left: 4px;
305+
padding-left: 0.5em;
296306
border: 1px solid #6c6c6c;
297307
}
298308
QDockWidget
@@ -308,9 +318,9 @@ QDockWidget::separator
308318
QDockWidget::title
309319
{
310320
text-align: center;
311-
spacing: 3px; /* spacing between items in the tool bar */
321+
spacing: 0.1em; /* spacing between items in the tool bar */
312322
background-color: @background;
313-
font-weight: bold;
323+
font-weight: bold;
314324
}
315325

316326
QDockWidget::close-button, QDockWidget::float-button
@@ -333,19 +343,19 @@ QMainWindow::separator
333343
{
334344
/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434);*/
335345
color: white;
336-
padding-left: 4px;
346+
padding-left: 0.2em;
337347
border: 0px solid #4c4c4c;
338-
spacing: 3px; /* spacing between items in the tool bar */
348+
spacing: 0.1em; /* spacing between items in the tool bar */
339349
}
340350

341351
QMainWindow::separator:hover
342352
{
343353

344354
/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f);*/
345355
color: white;
346-
padding-left: 4px;
356+
padding-left: 0.2em;
347357
border: 1px solid #6c6c6c;
348-
spacing: 3px; /* spacing between items in the tool bar */
358+
spacing: 0.1em; /* spacing between items in the tool bar */
349359
}
350360

351361
QToolBar {
@@ -356,21 +366,29 @@ QToolBar {
356366
QToolBar::handle:horizontal
357367
{
358368
image: url(@theme_path/icons/handle-horizontal.svg);
369+
width: 0.2em;
370+
height: 0.5em;
359371
}
360372

361373
QToolBar::handle:vertical
362374
{
363375
image: url(@theme_path/icons/handle-vertical.svg);
376+
width: 0.5em;
377+
height: 0.2em;
364378
}
365379

366380
QToolBar::separator:horizontal
367381
{
368382
image: url(@theme_path/icons/separator-horizontal.svg);
383+
width: 0.2em;
384+
height: 0.5em;
369385
}
370386

371387
QToolBar::separator:vertical
372388
{
373389
image: url(@theme_path/icons/separator-vertical.svg);
390+
width: 0.5em;
391+
height: 0.2em;
374392
}
375393

376394
QMenu::separator
@@ -401,11 +419,11 @@ QTabBar::tab {
401419
border: 1px solid @itemdarkbackground;
402420
border-bottom: none;
403421
background-color: @background;
404-
padding-left: 10px;
405-
padding-right: 10px;
406-
padding-top: 3px;
407-
padding-bottom: 2px;
408-
margin-right: -1px;
422+
padding-left: 0.8em;
423+
padding-right: 0.8em;
424+
padding-top: 0.1em;
425+
padding-bottom: 0.1em;
426+
margin-right: -0.05em;
409427
}
410428

411429
QTabBar::tab:last
@@ -415,7 +433,7 @@ QTabBar::tab:last
415433

416434
QTabBar::tab:first:!selected
417435
{
418-
margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */
436+
margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */
419437
}
420438

421439
QTabBar::tab:bottom {
@@ -425,7 +443,7 @@ QTabBar::tab:bottom {
425443

426444
QTabBar::tab:!selected
427445
{
428-
margin-top: 5px;
446+
margin-top: 0.3em;
429447
}
430448

431449
QTabBar::tab:selected
@@ -458,11 +476,15 @@ QGroupBox::title {
458476
QGroupBox::indicator:unchecked {
459477
border: 1px solid @background;
460478
image: url(@theme_path/icons/qcheckbox-unchecked.svg);
479+
width:0.8em;
480+
height:0.8em;
461481
}
462482

463483
QGroupBox::indicator:checked {
464484
border: 1px solid @background;
465485
image: url(@theme_path/icons/qcheckbox-checked.svg);
486+
width:0.8em;
487+
height:0.8em;
466488
}
467489

468490
/* ==================================================================================== */
@@ -472,11 +494,15 @@ QGroupBox::indicator:checked {
472494
QRadioButton::indicator:unchecked {
473495
border: 1px solid @background;
474496
image: url(@theme_path/icons/qradiobox-unchecked.svg);
497+
width:0.8em;
498+
height:0.8em;
475499
}
476500

477501
QRadioButton::indicator:checked {
478502
border: 1px solid @background;
479503
image: url(@theme_path/icons/qradiobox-checked.svg);
504+
width:0.8em;
505+
height:0.8em;
480506
}
481507

482508
/* ==================================================================================== */
@@ -486,11 +512,15 @@ QRadioButton::indicator:checked {
486512
QCheckBox::indicator:unchecked {
487513
border: 1px solid @background;
488514
image: url(@theme_path/icons/qcheckbox-unchecked.svg);
515+
width:0.8em;
516+
height:0.8em;
489517
}
490518

491519
QCheckBox::indicator:checked {
492520
border: 1px solid @background;
493521
image: url(@theme_path/icons/qcheckbox-checked.svg);
522+
width:0.8em;
523+
height:0.8em;
494524
}
495525

496526
/* ==================================================================================== */
@@ -500,24 +530,24 @@ QCheckBox::indicator:checked {
500530
QSlider::groove:horizontal,
501531
QSlider::groove:vertical {
502532
border: 1px solid @itemdarkbackground;
503-
height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
533+
height: 0.4em; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
504534
background-color: @itembackground;
505535
margin: 2px 0;
506536
}
507537

508538
QSlider::handle:horizontal {
509539
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
510540
border: 1px solid itemdarkbackground;
511-
width: 18px;
541+
width: 1em;
512542
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
513-
border-radius: 3px;
543+
border-radius: 0.15em;
514544
}
515545
QSlider::handle:vertical {
516546
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
517547
border: 1px solid itemdarkbackground;
518-
height: 18px;
548+
height: 1em;
519549
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
520-
border-radius: 3px;
550+
border-radius: 0.15em;
521551
}
522552

523553
/* ==================================================================================== */
@@ -530,7 +560,7 @@ QAbstractItemView, QListView
530560
alternate-background-color: @itemalternativebackground;
531561
color: @text;
532562
border: none;
533-
border-radius: 3px;
563+
border-radius: 0.15em;
534564
padding: 1px;
535565
selection-color: @text;
536566
selection-background-color: @selection;
@@ -583,7 +613,7 @@ QTreeView#viewGraduated::item,
583613
QTreeView#viewCategories::item,
584614
QTreeView#viewRules::item
585615
{
586-
padding: 1px 0px 1px 0px;
616+
padding: 0.1em 0em 0.1em 0em;
587617
}
588618

589619
QgsLayerTreeView::indicator:unchecked,
@@ -615,7 +645,7 @@ QHeaderView::section {
615645
background-color: @background;
616646
color: @text;
617647
border-right: 1px solid @itemdarkbackground;
618-
padding: 0 0 2px 3px
648+
padding: 0 0 0.1em 0.2em;
619649
}
620650

621651
/* ==================================================================================== */
@@ -642,5 +672,5 @@ QListWidget#mOptionsListWidget {
642672
}
643673

644674
QListWidget#mOptionsListWidget::item {
645-
padding: 3px;
675+
padding: 0.1em;
646676
}

0 commit comments

Comments
 (0)
Please sign in to comment.