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>
This commit is contained in:
Tomaz Canabrava 2013-12-24 09:49:38 -02:00 committed by Dirk Hohndel
parent 10519bcc50
commit 231fd2e6e0

View file

@ -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);
}