convenience accessor to background widget colour

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758502
This commit is contained in:
Aaron J. Seigo 2008-01-08 01:43:13 +00:00
parent ee32d3c996
commit 2e050f7b05
2 changed files with 11 additions and 0 deletions

View File

@ -167,6 +167,12 @@ QColor Theme::textColor() const
return colors.foreground(KColorScheme::NormalText).color(); 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) void Theme::setFont(const QFont &font)
{ {
d->generalFont = font; d->generalFont = font;

View File

@ -103,6 +103,11 @@ class PLASMA_EXPORT Theme : public QObject
*/ */
Q_INVOKABLE QColor textColor() const; 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 * Sets the default font to be used with themed items. Defaults to
* the application wide default font. * the application wide default font.