[themes] Fix selection color of the attribute table view widget

This commit is contained in:
Mathieu Pellerin 2019-01-23 19:39:54 +07:00
parent 9068f3c9a4
commit 263c4c2a50
3 changed files with 14 additions and 11 deletions

View File

@ -685,6 +685,8 @@ QTreeView#viewRules::indicator:checked
QTableView {
color: @text;
selection-background-color: @selection;
selection-color: @itemdarkbackground;
}
QHeaderView::section {

View File

@ -697,6 +697,8 @@ QTreeView#viewRules::indicator:checked
QTableView {
color: @text;
selection-background-color: @selection;
selection-color: @text;
}
QHeaderView::section {

View File

@ -152,20 +152,19 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
style += QStringLiteral( "QToolBar > QToolButton { padding: %1px; } " ).arg( toolbarSpacingInt );
}
}
ss += style;
// Fix selection color on losing focus (Windows)
const QPalette palette = qApp->palette();
ss += QString( "QTableView {"
"selection-background-color: %1;"
"selection-color: %2;"
"}" )
.arg( palette.highlight().color().name(),
palette.highlightedText().color().name() );
}
// Fix selection color on losing focus (Windows)
const QPalette palette = qApp->palette();
ss += QString( "QTableView {"
"selection-background-color: %1;"
"selection-color: %2;"
"}" )
.arg( palette.highlight().color().name(),
palette.highlightedText().color().name() );
QgsDebugMsg( QStringLiteral( "Stylesheet built: %1" ).arg( ss ) );
emit appStyleSheetChanged( ss );