diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-12-24 09:49:38 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-24 07:23:10 -0800 |
commit | 231fd2e6e04009c6e895dffb0567d76418119b53 (patch) | |
tree | 514e7ef523d9599cc95dffa34705d6bfc9f31fac /qt-ui/maintab.cpp | |
parent | 10519bcc50bbb87317252878cd9d1f9aee6b522f (diff) | |
download | subsurface-231fd2e6e04009c6e895dffb0567d76418119b53.tar.gz |
Fix subsurface on dark themes.
This patch fixes my last annoyances with dark themes
on subsurface. It changes the background color of the
edited info tab to a darker yellow if the theme is
dark, and a light yellow if the theme is light.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 5d020268c..03d75bd98 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -813,7 +813,12 @@ void MainTab::rejectChanges() void markChangedWidget(QWidget *w){ QPalette p; - p.setBrush(QPalette::Base, QColor(Qt::yellow).lighter()); + qreal h, s, l, a; + qApp->palette().color(QPalette::Text).getHslF(&h, &s, &l, &a); + p.setBrush(QPalette::Base, ( l <= 0.3 ) ? QColor(Qt::yellow).lighter() + :( l <= 0.6 ) ? QColor(Qt::yellow).light() + :/* else */ QColor(Qt::yellow).darker(300) + ); w->setPalette(p); } |