textColor() convenience method
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=742361
This commit is contained in:
parent
f63f585f1a
commit
3166344116
11
theme.cpp
11
theme.cpp
@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
#include <KColorScheme>
|
||||||
|
#include <KConfigGroup>
|
||||||
|
#include <KDebug>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
#include <KStandardDirs>
|
#include <KStandardDirs>
|
||||||
#include <kdebug.h>
|
|
||||||
#include <kconfiggroup.h>
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -157,6 +158,12 @@ KSharedConfigPtr Theme::colors() const
|
|||||||
return d->colors;
|
return d->colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor Theme::textColor() const
|
||||||
|
{
|
||||||
|
KColorScheme colors(QPalette::Active, KColorScheme::View, Theme::self()->colors());
|
||||||
|
return colors.foreground(KColorScheme::NormalText).color();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <theme.moc>
|
#include <theme.moc>
|
||||||
|
5
theme.h
5
theme.h
@ -96,6 +96,11 @@ class PLASMA_EXPORT Theme : public QObject
|
|||||||
*/
|
*/
|
||||||
Q_INVOKABLE KSharedConfigPtr colors() const;
|
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:
|
Q_SIGNALS:
|
||||||
/**
|
/**
|
||||||
* Emitted when the user changes the theme. SVGs should be reloaded at
|
* Emitted when the user changes the theme. SVGs should be reloaded at
|
||||||
|
Loading…
Reference in New Issue
Block a user