update with the theme

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=823768
This commit is contained in:
Aaron J. Seigo 2008-06-24 03:15:56 +00:00
parent f359a0f551
commit 03d7946373
2 changed files with 21 additions and 10 deletions

View File

@ -34,8 +34,9 @@ namespace Plasma
class Label::Private
{
public:
Private()
: svg(0)
Private(Label *label)
: q(label),
svg(0)
{
}
@ -64,6 +65,17 @@ public:
static_cast<QLabel*>(q->widget())->setPixmap(pm);
}
void setPalette()
{
QLabel *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);
}
Label *q;
QString imagePath;
QString absImagePath;
Svg *svg;
@ -71,18 +83,15 @@ public:
Label::Label(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new Private(this))
{
QLabel* native = new QLabel;
QPalette p = native->palette();
QColor color = Theme::defaultTheme()->color(Theme::TextColor);
p.setColor(QPalette::Normal, QPalette::WindowText, color);
p.setColor(QPalette::Inactive, QPalette::WindowText, color);
native->setPalette(p);
setWidget(native);
connect(Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(setPalette()));
native->setAttribute(Qt::WA_NoSystemBackground);
native->setWordWrap(true);
setWidget(native);
d->setPalette();
}
Label::~Label()

View File

@ -91,6 +91,8 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
Q_PRIVATE_SLOT(d, void setPalette())
class Private;
Private * const d;
};