From 2e050f7b05663166f16936c155550f0c670e7a53 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 8 Jan 2008 01:43:13 +0000 Subject: [PATCH] convenience accessor to background widget colour svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758502 --- theme.cpp | 6 ++++++ theme.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/theme.cpp b/theme.cpp index e550d2afb..28f5d01d4 100644 --- a/theme.cpp +++ b/theme.cpp @@ -167,6 +167,12 @@ QColor Theme::textColor() const return colors.foreground(KColorScheme::NormalText).color(); } +QColor Theme::backgroundColor() const +{ + KColorScheme colors(QPalette::Active, KColorScheme::Window, Theme::self()->colors()); + return colors.background().color(); +} + void Theme::setFont(const QFont &font) { d->generalFont = font; diff --git a/theme.h b/theme.h index c108ab86d..6cb06e4b5 100644 --- a/theme.h +++ b/theme.h @@ -103,6 +103,11 @@ class PLASMA_EXPORT Theme : public QObject */ Q_INVOKABLE QColor textColor() const; + /** + * Returns the background color to be used by items resting on the background + */ + Q_INVOKABLE QColor backgroundColor() const; + /** * Sets the default font to be used with themed items. Defaults to * the application wide default font.