Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[themes] Fix selection color of the attribute table view widget
  • Loading branch information
nirvn committed Jan 23, 2019
1 parent 9068f3c commit 263c4c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions resources/themes/Blend of Gray/style.qss
Expand Up @@ -685,6 +685,8 @@ QTreeView#viewRules::indicator:checked

QTableView {
color: @text;
selection-background-color: @selection;
selection-color: @itemdarkbackground;
}

QHeaderView::section {
Expand Down
2 changes: 2 additions & 0 deletions resources/themes/Night Mapping/style.qss
Expand Up @@ -697,6 +697,8 @@ QTreeView#viewRules::indicator:checked

QTableView {
color: @text;
selection-background-color: @selection;
selection-color: @text;
}

QHeaderView::section {
Expand Down
19 changes: 9 additions & 10 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -152,19 +152,18 @@ 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();
// 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() );
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 ) );

Expand Down

6 comments on commit 263c4c2

@nirvn
Copy link
Contributor Author

@nirvn nirvn commented on 263c4c2 Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before vs. now:
image

@Gustry
Copy link
Contributor

@Gustry Gustry commented on 263c4c2 Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

I also noticed in the sublayer dialog (when you open an OSM file), it's not obvious to see which rows are selected in the new theme. Is-it on your list?

@nirvn
Copy link
Contributor Author

@nirvn nirvn commented on 263c4c2 Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gustry, could you attach a screenshot?

@Gustry
Copy link
Contributor

@Gustry Gustry commented on 263c4c2 Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshot from 2019-01-23 12-53-07

I had to think quickly which color is the selected/not selected.

@nirvn
Copy link
Contributor Author

@nirvn nirvn commented on 263c4c2 Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haa that's not a bug, this is just you in need of getting familiar with the selected background color ;) I'm hoping the commits today adding selection background color to all widgets will make it easier to familiarize users faster.

Blend of Gray relies solely on shades of gray, hence the selection background being near white.

@nirvn
Copy link
Contributor Author

@nirvn nirvn commented on 263c4c2 Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, glad to see you're (trying to? :) ) adopt the new theme. C est super!

Please sign in to comment.