From kde-commits Thu Oct 02 03:55:02 2008 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Thu, 02 Oct 2008 03:55:02 +0000 To: kde-commits Subject: KDE/kdebase/workspace/libs/plasma/widgets Message-Id: <1222919702.263578.26887.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122291971215787 SVN commit 866855 by aseigo: update when the theme does M +11 -8 checkbox.cpp M +1 -0 checkbox.h --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/checkbox.cpp #866854:866855 @@ -34,8 +34,9 @@ class CheckBoxPrivate { public: - CheckBoxPrivate() - : svg(0) + CheckBoxPrivate(CheckBox *c) + : q(c), + svg(0) { } @@ -44,7 +45,7 @@ delete svg; } - void setPixmap(CheckBox *q) + void setPixmap() { if (imagePath.isEmpty()) { return; @@ -64,7 +65,7 @@ static_cast(q->widget())->setIcon(QIcon(pm)); } - void setPalette(CheckBox *q) + void setPalette() { QCheckBox *native = q->nativeWidget(); QColor color = Theme::defaultTheme()->color(Theme::TextColor); @@ -74,6 +75,7 @@ native->setPalette(p); } + CheckBox *q; QString imagePath; QString absImagePath; Svg *svg; @@ -81,13 +83,14 @@ CheckBox::CheckBox(QGraphicsWidget *parent) : QGraphicsProxyWidget(parent), - d(new CheckBoxPrivate) + d(new CheckBoxPrivate(this)) { QCheckBox* native = new QCheckBox; connect(native, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); setWidget(native); - d->setPalette(this); + d->setPalette(); native->setAttribute(Qt::WA_NoSystemBackground); + connect(Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(setPalette())); } CheckBox::~CheckBox() @@ -130,7 +133,7 @@ d->absImagePath = Theme::defaultTheme()->imagePath(path); } - d->setPixmap(this); + d->setPixmap(); } QString CheckBox::image() const @@ -155,7 +158,7 @@ void CheckBox::resizeEvent(QGraphicsSceneResizeEvent *event) { - d->setPixmap(this); + d->setPixmap(); QGraphicsProxyWidget::resizeEvent(event); } --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/checkbox.h #866854:866855 @@ -112,6 +112,7 @@ void resizeEvent(QGraphicsSceneResizeEvent *event); private: + Q_PRIVATE_SLOT(d, void setPalette()) CheckBoxPrivate * const d; };