From kde-commits Thu Oct 02 03:36:12 2008 From: =?utf-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 02 Oct 2008 03:36:12 +0000 To: kde-commits Subject: KDE/kdebase/workspace/libs/plasma/widgets Message-Id: <1222918572.380293.25124.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122291858114728 SVN commit 866848 by sebas: Respect Plasma's colour scheme M +12 -1 checkbox.cpp --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/checkbox.cpp #866847:866848 @@ -64,6 +64,16 @@ static_cast(q->widget())->setIcon(QIcon(pm)); } + void setPalette(CheckBox *q) + { + QCheckBox *native = q->nativeWidget(); + QColor color = Theme::defaultTheme()->color(Theme::TextColor); + QPalette p = native->palette(); + p.setColor(QPalette::Normal, QPalette::WindowText, color); + p.setColor(QPalette::Inactive, QPalette::WindowText, color); + native->setPalette(p); + } + QString imagePath; QString absImagePath; Svg *svg; @@ -76,6 +86,7 @@ QCheckBox* native = new QCheckBox; connect(native, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); setWidget(native); + d->setPalette(this); native->setAttribute(Qt::WA_NoSystemBackground); } @@ -104,7 +115,7 @@ d->svg = 0; d->imagePath = path; - bool absolutePath = !path.isEmpty() && + bool absolutePath = !path.isEmpty() && #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else