[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma/widgets
From:       Sebastian Kügler <sebas () kde ! org>
Date:       2008-10-02 3:36:12
Message-ID: 1222918572.380293.25124.nullmailer () svn ! kde ! org
[Download RAW message or body]

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<QCheckBox*>(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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic