Skip to content

Commit

Permalink
Fix item view style (#204)
Browse files Browse the repository at this point in the history
From Qt 6.4.1, some item view style are changed.
I don't know this is bug or not.
Anyway I make this change close to previous style, because new style is dirty.
  • Loading branch information
5yutan5 authored Dec 12, 2022
1 parent f26d151 commit ddc345e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
18 changes: 13 additions & 5 deletions qdarktheme/_resources/_template_stylesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,12 @@
QTreeView::branch:!selected:hover {
background: {{ list.hoverBackground|color }};
}
QTreeView::branch:!selected:hover,
QTreeView::branch:alternate,
QTreeView::branch:selected,
QTreeView::branch:selected:!active {
{{ |env(value="background: transparent;", version=">=6.4.1") }}
}
QTreeView::branch {
border-image: {{ tree.inactiveIndentGuidesStroke|color|url(id="vertical_line") }} 0;
}
Expand Down Expand Up @@ -860,15 +866,17 @@
QTableView {
gridline-color: {{ tableSectionHeader.background|color }};
background: {{ background|color(state="table") }};
{{ primary|color(state="table.selectionBackground")|env(value="selection-background-color: ${};", version=">=6.4.1") }}
{{ table.alternateBackground|color|env(value="alternate-background-color: ${};", version=">=6.4.1") }}
}
QTableView:!active {
{{ primary|color(state="table.inactiveSelectionBackground")|env(value="selection-background-color: ${};", version="<6.4.1") }}
}
QTableView::item:alternate {
background: {{ table.alternateBackground|color }};
{{ table.alternateBackground|color|env(value="background: ${};", version="<6.4.1") }}
}
QTableView::item:selected {
background: {{ primary|color(state="table.selectionBackground") }};
}
QTableView::item:selected:!active {
background: {{ primary|color(state="table.inactiveSelectionBackground") }};
{{ primary|color(state="table.selectionBackground")|env(value="background: ${};", version="<6.4.1") }}
}
QTableView QTableCornerButton::section {
margin: 0 1px 1px 0;
Expand Down
18 changes: 13 additions & 5 deletions style/base.qss
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,12 @@ QTreeView::item:!selected:hover,
QTreeView::branch:!selected:hover {
background: {{ list.hoverBackground|color }};
}
QTreeView::branch:!selected:hover,
QTreeView::branch:alternate,
QTreeView::branch:selected,
QTreeView::branch:selected:!active {
{{ |env(value="background: transparent;", version=">=6.4.1") }}
}
QTreeView::branch {
border-image: {{ tree.inactiveIndentGuidesStroke|color|url(id="vertical_line") }} 0;
}
Expand Down Expand Up @@ -1079,15 +1085,17 @@ examples: https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtableview
QTableView {
gridline-color: {{ tableSectionHeader.background|color }};
background: {{ background|color(state="table") }};
{{ primary|color(state="table.selectionBackground")|env(value="selection-background-color: ${};", version=">=6.4.1") }}
{{ table.alternateBackground|color|env(value="alternate-background-color: ${};", version=">=6.4.1") }}
}
QTableView:!active {
{{ primary|color(state="table.inactiveSelectionBackground")|env(value="selection-background-color: ${};", version="<6.4.1") }}
}
QTableView::item:alternate {
background: {{ table.alternateBackground|color }};
{{ table.alternateBackground|color|env(value="background: ${};", version="<6.4.1") }}
}
QTableView::item:selected {
background: {{ primary|color(state="table.selectionBackground") }};
}
QTableView::item:selected:!active {
background: {{ primary|color(state="table.inactiveSelectionBackground") }};
{{ primary|color(state="table.selectionBackground")|env(value="background: ${};", version="<6.4.1") }}
}

QTableView QTableCornerButton::section {
Expand Down

0 comments on commit ddc345e

Please sign in to comment.