From 31663441160572707a31fecf0fc82df33b6e96e7 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 27 Nov 2007 21:56:47 +0000 Subject: [PATCH] textColor() convenience method svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=742361 --- theme.cpp | 11 +++++++++-- theme.h | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/theme.cpp b/theme.cpp index 4ae9a12ab..a19fe3466 100644 --- a/theme.cpp +++ b/theme.cpp @@ -21,10 +21,11 @@ #include +#include +#include +#include #include #include -#include -#include namespace Plasma { @@ -157,6 +158,12 @@ KSharedConfigPtr Theme::colors() const return d->colors; } +QColor Theme::textColor() const +{ + KColorScheme colors(QPalette::Active, KColorScheme::View, Theme::self()->colors()); + return colors.foreground(KColorScheme::NormalText).color(); +} + } #include diff --git a/theme.h b/theme.h index a2f88a40a..bb03343a4 100644 --- a/theme.h +++ b/theme.h @@ -96,6 +96,11 @@ class PLASMA_EXPORT Theme : public QObject */ Q_INVOKABLE KSharedConfigPtr colors() const; + /** + * Returns the text color to be used by items resting on the background + */ + Q_INVOKABLE QColor textColor() const; + Q_SIGNALS: /** * Emitted when the user changes the theme. SVGs should be reloaded at