use plasma colours by default for the text

svn path=/trunk/KDE/kdelibs/; revision=1053269
This commit is contained in:
Aaron J. Seigo 2009-11-23 18:49:25 +00:00
parent f97924aee3
commit 3ad39b384c
2 changed files with 11 additions and 1 deletions

View File

@ -31,6 +31,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <plasma/animator.h> #include <plasma/animator.h>
#include <plasma/theme.h>
using namespace Plasma; using namespace Plasma;
@ -50,7 +51,7 @@ class Plasma::FlashingLabelPrivate
: q(flash), : q(flash),
defaultDuration(3000), defaultDuration(3000),
type(FlashingLabelPrivate::Text), type(FlashingLabelPrivate::Text),
color(Qt::black), color(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor)),
animId(0), animId(0),
state(FlashingLabelPrivate::Invisible), state(FlashingLabelPrivate::Invisible),
autohide(false) autohide(false)
@ -59,6 +60,7 @@ class Plasma::FlashingLabelPrivate
fadeOutTimer.setSingleShot(true); fadeOutTimer.setSingleShot(true);
fadeInTimer.setInterval(0); fadeInTimer.setInterval(0);
fadeInTimer.setSingleShot(true); fadeInTimer.setSingleShot(true);
QObject::connect(Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(setPalette()));
} }
~FlashingLabelPrivate() { } ~FlashingLabelPrivate() { }
@ -66,6 +68,7 @@ class Plasma::FlashingLabelPrivate
void renderPixmap(const QSize &size); void renderPixmap(const QSize &size);
void setupFlash(int duration); void setupFlash(int duration);
void elementAnimationFinished(int); void elementAnimationFinished(int);
void setPalette();
FlashingLabel *q; FlashingLabel *q;
int defaultDuration; 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" #include "flashinglabel.moc"

View File

@ -79,6 +79,7 @@ protected Q_SLOTS:
private: private:
Q_PRIVATE_SLOT(d, void elementAnimationFinished(int)) Q_PRIVATE_SLOT(d, void elementAnimationFinished(int))
Q_PRIVATE_SLOT(d, void setPalette())
FlashingLabelPrivate *const d; FlashingLabelPrivate *const d;
}; };