Skip to content

Commit 0647188

Browse files
committed
[themes] Properly style table/list view headers
1 parent b080ab5 commit 0647188

File tree

3 files changed

+87
-31
lines changed

3 files changed

+87
-31
lines changed

resources/themes/Blend of Gray/style.qss

+40-11
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,6 @@ QSizeGrip
337337
width: 0.1em;
338338
}
339339

340-
QHeaderView::section
341-
{
342-
/*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);*/
343-
color: @text;
344-
padding-left: 0.5em;
345-
border: 1px solid #6c6c6c;
346-
}
347340
QDockWidget
348341
{
349342
titlebar-close-icon: url(@theme_path/icons/close.svg);
@@ -619,7 +612,7 @@ QAbstractItemView, QListView
619612
background-color: @itembackground;
620613
alternate-background-color: @itemalternativebackground;
621614
color: @text;
622-
border: none;
615+
border: 1px solid @itemdarkbackground;
623616
border-radius: 0.15em;
624617
padding: 1px;
625618
selection-background-color: @selection;
@@ -702,12 +695,48 @@ QTableView {
702695
selection-color: @itemdarkbackground;
703696
}
704697

705-
QHeaderView::section {
698+
QTableView QTableCornerButton::section {
699+
background-color: @background;
700+
border: 1px solid @itembackground;
701+
}
702+
703+
QHeaderView {
704+
background-color:transparent;
705+
border:0;
706+
}
707+
708+
QHeaderView::section, QHeaderView::section:vertical {
709+
padding: 0.1m 0.2em 0.1em 0.2em;
706710
background: transparent;
707711
background-color: @background;
708712
color: @text;
709-
border-right: 1px solid @itemdarkbackground;
710-
padding: 0 0 0.1em 0.2em;
713+
border: 1px solid @itemdarkbackground;
714+
border-left: 0;
715+
border-top: 0;
716+
}
717+
718+
QHeaderView::section:vertical {
719+
border: 1px solid @itemdarkbackground;
720+
border-left: 0;
721+
border-top: 0;
722+
}
723+
724+
QHeaderView::section:last:vertical {
725+
border-bottom: 0;
726+
}
727+
728+
QHeaderView::section:last:horizontal {
729+
border-right: 0;
730+
}
731+
732+
QHeaderView::down-arrow {
733+
width: 1.2em;
734+
image: url(@theme_path/icons/arrow-down.svg);
735+
}
736+
737+
QHeaderView::up-arrow {
738+
width: 1.2em;
739+
image: url(@theme_path/icons/arrow-up.svg);
711740
}
712741

713742
/* ==================================================================================== */

resources/themes/Night Mapping/palette.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
0:#aaaaaa
2-
2:#535353
2+
2:#323232
33
5:#222222
44
9:#535353
55
10:#535353

resources/themes/Night Mapping/style.qss

+46-19
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ QScrollBar:horizontal {
317317
QScrollBar::handle:horizontal {
318318
border: 1px solid @itemdarkbackground;
319319
background: @background;
320-
min-width: 0.8em;
321320
}
322321

323322
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal,
@@ -335,7 +334,6 @@ QScrollBar:vertical {
335334
QScrollBar::handle:vertical {
336335
border: 1px solid @itemdarkbackground;
337336
background: @background;
338-
min-height: 0.8em;
339337
}
340338

341339
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical,
@@ -350,13 +348,6 @@ QSizeGrip
350348
width: 0.1em;
351349
}
352350

353-
QHeaderView::section
354-
{
355-
/*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);*/
356-
color: @text;
357-
padding-left: 0.5em;
358-
border: 1px solid #6c6c6c;
359-
}
360351
QDockWidget
361352
{
362353
titlebar-close-icon: url(@theme_path/icons/close.svg);
@@ -630,7 +621,7 @@ QAbstractItemView, QListView
630621
background-color: @itembackground;
631622
alternate-background-color: @background;
632623
color: @text;
633-
border: none;
624+
border: 1px solid @itemdarkbackground;
634625
border-radius: 0px;
635626
padding: 1px;
636627
selection-color: @text;
@@ -715,20 +706,49 @@ QTableView {
715706
selection-color: @text;
716707
}
717708

718-
QHeaderView::section {
709+
710+
QTableView QTableCornerButton::section {
711+
background-color: @background;
712+
border: 1px solid @itembackground;
713+
}
714+
715+
QHeaderView {
716+
background-color:transparent;
717+
border:0;
718+
}
719+
720+
QHeaderView::section, QHeaderView::section:vertical {
721+
padding: 0.1m 0.2em 0.1em 0.2em;
719722
background: transparent;
720723
background-color: @background;
721724
color: @text;
722-
border-right: 1px solid @itemdarkbackground;
723-
padding: 0 0 0.1em 0.2em;
725+
border: 1px solid @itemdarkbackground;
726+
border-left: 0;
727+
border-top: 0;
724728
}
725729

726-
QToolButton[autoRaise=true]:focus:!pressed {
727-
border:1px solid @focusdark;
730+
QHeaderView::section:vertical {
731+
border: 1px solid @itemdarkbackground;
732+
border-left: 0;
733+
border-top: 0;
728734
}
729735

730-
QToolButton[autoRaise=false]:focus:!pressed {
731-
border:1px solid @focusdark;
736+
QHeaderView::section:last:vertical {
737+
border-bottom: 0;
738+
}
739+
740+
QHeaderView::section:last:horizontal {
741+
border-right: 0;
742+
}
743+
744+
QHeaderView::down-arrow {
745+
width: 1.2em;
746+
image: url(@theme_path/icons/arrow-down.svg);
747+
}
748+
749+
QHeaderView::up-arrow {
750+
width: 1.2em;
751+
image: url(@theme_path/icons/arrow-up.svg);
732752
}
733753

734754
/* ==================================================================================== */
@@ -737,13 +757,21 @@ QToolButton[autoRaise=false]:focus:!pressed {
737757

738758
QToolButton:focus, QPushButton:focus, QCheckBox:focus, QRadioButton:focus, QGroupBox:focus {
739759
outline:1px solid @focusdark;
740-
outline-radius: 0.2em;
760+
outline-radius: 0;
741761
}
742762

743763
QComboBox:focus, QAbstractSpinBox:focus, QLineEdit:focus, QPlainTextEdit:focus, QTextEdit:focus {
744764
border:1px solid @focusdark;
745765
}
746766

767+
QToolButton[autoRaise=true]:focus:!pressed {
768+
border:1px solid @focusdark;
769+
}
770+
771+
QToolButton[autoRaise=false]:focus:!pressed {
772+
border:1px solid @focusdark;
773+
}
774+
747775
/* ==================================================================================== */
748776
/* QGIS-SPECIFIC TWEAKS */
749777
/* ==================================================================================== */
@@ -812,7 +840,6 @@ QgsPropertyOverrideButton, QgsPropertyOverrideButton:hover, QgsPropertyOverrideB
812840

813841
QgsPropertyOverrideButton:focus {
814842
border:1px solid @focusdark;
815-
border-radius: 0.2em;
816843
}
817844

818845
QListWidget#mOptionsListWidget {

0 commit comments

Comments
 (0)