From 3ad39b384cca7be3acbadcab6ad8f5d597b58d05 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 23 Nov 2009 18:49:25 +0000 Subject: [PATCH] use plasma colours by default for the text svn path=/trunk/KDE/kdelibs/; revision=1053269 --- widgets/flashinglabel.cpp | 11 ++++++++++- widgets/flashinglabel.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/widgets/flashinglabel.cpp b/widgets/flashinglabel.cpp index 7f06d3d91..d9e4bfb2f 100644 --- a/widgets/flashinglabel.cpp +++ b/widgets/flashinglabel.cpp @@ -31,6 +31,7 @@ #include #include +#include using namespace Plasma; @@ -50,7 +51,7 @@ class Plasma::FlashingLabelPrivate : q(flash), defaultDuration(3000), type(FlashingLabelPrivate::Text), - color(Qt::black), + color(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor)), animId(0), state(FlashingLabelPrivate::Invisible), autohide(false) @@ -59,6 +60,7 @@ class Plasma::FlashingLabelPrivate fadeOutTimer.setSingleShot(true); fadeInTimer.setInterval(0); fadeInTimer.setSingleShot(true); + QObject::connect(Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(setPalette())); } ~FlashingLabelPrivate() { } @@ -66,6 +68,7 @@ class Plasma::FlashingLabelPrivate void renderPixmap(const QSize &size); void setupFlash(int duration); void elementAnimationFinished(int); + void setPalette(); FlashingLabel *q; int defaultDuration; @@ -300,4 +303,10 @@ void FlashingLabelPrivate::elementAnimationFinished(int id) } } +void FlashingLabelPrivate::setPalette() +{ + color = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor); + q->update(); +} + #include "flashinglabel.moc" diff --git a/widgets/flashinglabel.h b/widgets/flashinglabel.h index ee518b372..41584abff 100644 --- a/widgets/flashinglabel.h +++ b/widgets/flashinglabel.h @@ -79,6 +79,7 @@ protected Q_SLOTS: private: Q_PRIVATE_SLOT(d, void elementAnimationFinished(int)) + Q_PRIVATE_SLOT(d, void setPalette()) FlashingLabelPrivate *const d; };