From 231fd2e6e04009c6e895dffb0567d76418119b53 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 24 Dec 2013 09:49:38 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3-70-g09d2