Skip to content

Commit aa7d4a7

Browse files
committedJan 1, 2019
Make Night Mapping theme hidpi-compatible
1 parent 3c94d2f commit aa7d4a7

File tree

1 file changed

+70
-40
lines changed

1 file changed

+70
-40
lines changed
 

‎resources/themes/Night Mapping/style.qss

Lines changed: 70 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ 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;
5151
border-radius:0px;
5252
background-color: @darkgradient;
@@ -56,14 +56,20 @@ QAbstractSpinBox {
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,15 +114,15 @@ QWidget:disabled
108114

109115
QLineEdit
110116
{
111-
padding: 3px;
117+
padding: 0.1em;
112118
border: 1px solid #111;
113119
background-color: #888;
114120
color: #111;
115121
}
116122

117123
QTextEdit, QPlainTextEdit
118124
{
119-
padding: 3px;
125+
padding: 0.1em;
120126
border-width: 1px;
121127
border-color: @itemdarkbackground;
122128
border-style: solid;
@@ -127,7 +133,7 @@ QTextEdit, QPlainTextEdit
127133

128134
QPushButton
129135
{
130-
padding: 3px;
136+
padding: 0.1em;
131137
border-width: 1px;
132138
border-color: @itembackground;
133139
border-style: solid;
@@ -138,7 +144,7 @@ QPushButton
138144

139145
QToolButton
140146
{
141-
padding: 2px;
147+
padding: 0.1em;
142148
border-width: 1px;
143149
border-color: @itembackground;
144150
border-style: solid;
@@ -148,10 +154,10 @@ QToolButton
148154
}
149155
QToolButton[popupMode="1"]
150156
{
151-
padding-right: 18px;
157+
padding-right: 0.9em;
152158
}
153159
QToolButton::menu-button {
154-
width: 14px;
160+
width: 0.8em;
155161
border-width: 1px;
156162
border-color: none;
157163
border-radius: 0px;
@@ -172,6 +178,8 @@ QToolButton:checked
172178
QToolButton::menu-arrow
173179
{
174180
image: url(@theme_path/icons/arrow-down.svg);
181+
width: 0.8em;
182+
height: 1.2em;
175183
}
176184
QToolBar QToolButton, QToolButton::menu-button
177185
{
@@ -190,7 +198,7 @@ QComboBox {
190198
border-style: solid;
191199
border: 1px solid #1e1e1e;
192200
border-radius: 0px;
193-
padding: 3px;
201+
padding: 0.1em;
194202
}
195203

196204

@@ -199,8 +207,8 @@ QComboBox:hover,QPushButton:hover,QToolButton:hover,QAbstractSpinBox:hover {
199207
}
200208

201209
QComboBox:on {
202-
padding-top: 1px;
203-
padding-left: 3px;
210+
padding: 0.1em;
211+
padding-left: 0.2em;
204212
background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
205213
stop: 0 #555,
206214
stop: 0.1 #4C4C4C,
@@ -222,7 +230,7 @@ QComboBox:editable QLineEdit {
222230
QComboBox QAbstractItemView, QComboBox QListView {
223231
border: none;
224232
border-radius: 0px;
225-
padding: 3px;
233+
padding: 0.1em;
226234
background: @itemdarkbackground;
227235
color: @text;
228236
selection-background-color: @selection;
@@ -231,13 +239,15 @@ QComboBox QAbstractItemView, QComboBox QListView {
231239
QComboBox::drop-down {
232240
subcontrol-origin: padding;
233241
subcontrol-position: top right;
234-
width: 15px;
242+
width: 0.8em;
235243
border: 0px;
236244
}
237245

238246
QComboBox::down-arrow
239247
{
240248
image: url(@theme_path/icons/arrow-down.svg);
249+
width: 0.8em;
250+
height: 1.2em;
241251
}
242252

243253

@@ -258,7 +268,7 @@ QTextEdit:focus
258268

259269
QScrollBar:horizontal {
260270
background-color: #333;
261-
height: 8px;
271+
height: 0.5em;
262272
margin: 0px;
263273
padding: 0px;
264274
}
@@ -276,7 +286,7 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
276286

277287
QScrollBar:vertical {
278288
background-color: #333;
279-
width: 8px;
289+
width: 0.5em;
280290
margin: 0;
281291
}
282292

@@ -294,14 +304,14 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
294304

295305
QSizeGrip
296306
{
297-
width: 1px;
307+
width: 0.1em;
298308
}
299309

300310
QHeaderView::section
301311
{
302312
/*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);*/
303313
color: @text;
304-
padding-left: 4px;
314+
padding-left: 0.5em;
305315
border: 1px solid #6c6c6c;
306316
}
307317
QDockWidget
@@ -317,9 +327,9 @@ QDockWidget::separator
317327
QDockWidget::title
318328
{
319329
text-align: center;
320-
spacing: 3px; /* spacing between items in the tool bar */
330+
spacing: 0.1em; /* spacing between items in the tool bar */
321331
background-color: @background;
322-
font-weight: bold;
332+
font-weight: bold;
323333
}
324334

325335
QDockWidget::close-button, QDockWidget::float-button
@@ -342,19 +352,19 @@ QMainWindow::separator
342352
{
343353
/*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);*/
344354
color: white;
345-
padding-left: 4px;
355+
padding-left: 0.2em;
346356
border: 0px solid #4c4c4c;
347-
spacing: 3px; /* spacing between items in the tool bar */
357+
spacing: 0.1m; /* spacing between items in the tool bar */
348358
}
349359

350360
QMainWindow::separator:hover
351361
{
352362

353363
/*background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f);*/
354364
color: white;
355-
padding-left: 4px;
365+
padding-left: 0.2em;
356366
border: 1px solid #6c6c6c;
357-
spacing: 3px; /* spacing between items in the tool bar */
367+
spacing: 0.1em; /* spacing between items in the tool bar */
358368
}
359369

360370
QToolBar {
@@ -365,21 +375,29 @@ QToolBar {
365375
QToolBar::handle:horizontal
366376
{
367377
image: url(@theme_path/icons/handle-horizontal.svg);
378+
width: 0.2em;
379+
height: 0.5em;
368380
}
369381

370382
QToolBar::handle:vertical
371383
{
372384
image: url(@theme_path/icons/handle-vertical.svg);
385+
width: 0.5em;
386+
height: 0.2em;
373387
}
374388

375389
QToolBar::separator:horizontal
376390
{
377391
image: url(@theme_path/icons/separator-horizontal.svg);
392+
width: 0.2em;
393+
height: 0.5em;
378394
}
379395

380396
QToolBar::separator:vertical
381397
{
382398
image: url(@theme_path/icons/separator-vertical.svg);
399+
width: 0.5em;
400+
height: 0.2em;
383401
}
384402

385403
QMenu::separator
@@ -410,11 +428,11 @@ QTabBar::tab {
410428
border: 1px solid @itemdarkbackground;
411429
border-bottom: none;
412430
background-color: @background;
413-
padding-left: 10px;
414-
padding-right: 10px;
415-
padding-top: 3px;
416-
padding-bottom: 2px;
417-
margin-right: -1px;
431+
padding-left: 0.8em;
432+
padding-right: 0.8em;
433+
padding-top: 0.1em;
434+
padding-bottom: 0.1em;
435+
margin-right: -0.05em;
418436
}
419437

420438
QTabBar::tab:last
@@ -434,7 +452,7 @@ QTabBar::tab:bottom {
434452

435453
QTabBar::tab:!selected
436454
{
437-
margin-top: 5px;
455+
margin-top: 0.3em;
438456
}
439457

440458
QTabBar::tab:selected
@@ -467,11 +485,15 @@ QGroupBox::title {
467485
QGroupBox::indicator:unchecked {
468486
border: 1px solid @background;
469487
image: url(@theme_path/icons/qcheckbox-unchecked.svg);
488+
width:0.8em;
489+
height:0.8em;
470490
}
471491

472492
QGroupBox::indicator:checked {
473493
border: 1px solid @background;
474494
image: url(@theme_path/icons/qcheckbox-checked.svg);
495+
width:0.8em;
496+
height:0.8em;
475497
}
476498

477499
/* ==================================================================================== */
@@ -481,11 +503,15 @@ QGroupBox::indicator:checked {
481503
QRadioButton::indicator:unchecked {
482504
border: 1px solid @background;
483505
image: url(@theme_path/icons/qradiobox-unchecked.svg);
506+
width:0.8em;
507+
height:0.8em;
484508
}
485509

486510
QRadioButton::indicator:checked {
487511
border: 1px solid @background;
488512
image: url(@theme_path/icons/qradiobox-checked.svg);
513+
width:0.8em;
514+
height:0.8em;
489515
}
490516

491517
/* ==================================================================================== */
@@ -495,11 +521,15 @@ QRadioButton::indicator:checked {
495521
QCheckBox::indicator:unchecked {
496522
border: 1px solid @background;
497523
image: url(@theme_path/icons/qcheckbox-unchecked.svg);
524+
width:0.8em;
525+
height:0.8em;
498526
}
499527

500528
QCheckBox::indicator:checked {
501529
border: 1px solid @background;
502530
image: url(@theme_path/icons/qcheckbox-checked.svg);
531+
width:0.8em;
532+
height:0.8em;
503533
}
504534

505535
/* ==================================================================================== */
@@ -509,22 +539,22 @@ QCheckBox::indicator:checked {
509539
QSlider::groove:horizontal,
510540
QSlider::groove:vertical {
511541
border: 1px solid @itemdarkbackground;
512-
height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
542+
height: 0.4em; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
513543
background-color: @itembackground;
514544
margin: 2px 0;
515545
}
516546

517547
QSlider::handle:horizontal {
518548
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
519549
border: 1px solid itemdarkbackground;
520-
width: 18px;
550+
width: 1em;
521551
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
522552
border-radius: 0px;
523553
}
524554
QSlider::handle:vertical {
525555
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
526556
border: 1px solid itemdarkbackground;
527-
height: 18px;
557+
height: 1em;
528558
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
529559
border-radius: 0px;
530560
}
@@ -594,7 +624,7 @@ QTreeView#viewRules::item
594624
{
595625
border-top: 0.5px solid rgba(108,108,108,50);
596626
border-bottom: 0.5px solid rgba(108,108,108,50);
597-
padding: 1px 0px 1px 0px;
627+
padding: 0.1em 0em 0.1em 0em;
598628
}
599629

600630
QgsLayerTreeView::indicator:unchecked,
@@ -626,7 +656,7 @@ QHeaderView::section {
626656
background-color: @background;
627657
color: @text;
628658
border-right: 1px solid @itemdarkbackground;
629-
padding: 0 0 2px 3px
659+
padding: 0 0 0.1em 0.2em;
630660
}
631661

632662
/* ==================================================================================== */
@@ -653,5 +683,5 @@ QListWidget#mOptionsListWidget {
653683
}
654684

655685
QListWidget#mOptionsListWidget::item {
656-
padding: 3px;
686+
padding: 0.1em;
657687
}

0 commit comments

Comments
 (0)
Please sign in to comment.