Color properties move into Plasma::Theme

They're now convenience API in Plasma:Theme, PlasmaCore.Theme is
becoming smaller and smaller. Another nail in its coffin.
This commit is contained in:
Sebastian Kügler 2014-01-12 19:49:56 +01:00
parent 13242c8a5f
commit 25dcdd39a4
4 changed files with 95 additions and 95 deletions

View File

@ -79,71 +79,6 @@ QString ThemeProxy::wallpaperPathForSize(int width, int height) const
return Plasma::Theme::wallpaperPath(QSize(width, height));
}
QColor ThemeProxy::textColor() const
{
return Plasma::Theme::color(Plasma::Theme::TextColor);
}
QColor ThemeProxy::highlightColor() const
{
return Plasma::Theme::color(Plasma::Theme::HighlightColor);
}
QColor ThemeProxy::backgroundColor() const
{
return Plasma::Theme::color(Plasma::Theme::BackgroundColor);
}
QColor ThemeProxy::buttonTextColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonTextColor);
}
QColor ThemeProxy::buttonBackgroundColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonBackgroundColor);
}
QColor ThemeProxy::linkColor() const
{
return Plasma::Theme::color(Plasma::Theme::LinkColor);
}
QColor ThemeProxy::visitedLinkColor() const
{
return Plasma::Theme::color(Plasma::Theme::VisitedLinkColor);
}
QColor ThemeProxy::buttonHoverColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonHoverColor);
}
QColor ThemeProxy::buttonFocusColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonFocusColor);
}
QColor ThemeProxy::viewTextColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewTextColor);
}
QColor ThemeProxy::viewBackgroundColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewBackgroundColor);
}
QColor ThemeProxy::viewHoverColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewHoverColor);
}
QColor ThemeProxy::viewFocusColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewFocusColor);
}
QString ThemeProxy::styleSheet() const
{
return Plasma::Theme::styleSheet(QString());

View File

@ -40,23 +40,6 @@ class ThemeProxy : public Plasma::Theme
{
Q_OBJECT
// colors
Q_PROPERTY(QColor textColor READ textColor NOTIFY themeChanged)
Q_PROPERTY(QColor highlightColor READ highlightColor NOTIFY themeChanged)
Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonTextColor READ buttonTextColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY themeChanged)
Q_PROPERTY(QColor linkColor READ linkColor NOTIFY themeChanged)
Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChanged)
Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonFocusColor READ buttonFocusColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewTextColor READ viewTextColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewBackgroundColor READ viewBackgroundColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewHoverColor READ viewHoverColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewFocusColor READ viewFocusColor NOTIFY themeChanged)
Q_PROPERTY(QString styleSheet READ styleSheet NOTIFY themeChanged)
// icon sizes
Q_PROPERTY(int smallIconSize READ smallIconSize CONSTANT)
Q_PROPERTY(int smallMediumIconSize READ smallMediumIconSize CONSTANT)
@ -93,19 +76,6 @@ public:
Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const;
QColor textColor() const;
QColor highlightColor() const;
QColor backgroundColor() const;
QColor buttonTextColor() const;
QColor buttonBackgroundColor() const;
QColor linkColor() const;
QColor visitedLinkColor() const;
QColor buttonHoverColor() const;
QColor buttonFocusColor() const;
QColor viewTextColor() const;
QColor viewBackgroundColor() const;
QColor viewHoverColor() const;
QColor viewFocusColor() const;
QString styleSheet() const;
int smallIconSize() const;

View File

@ -465,6 +465,70 @@ QFont Theme::smallestFont() const
return QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
}
QColor Theme::textColor() const
{
return Plasma::Theme::color(Plasma::Theme::TextColor);
}
QColor Theme::highlightColor() const
{
return Plasma::Theme::color(Plasma::Theme::HighlightColor);
}
QColor Theme::backgroundColor() const
{
return Plasma::Theme::color(Plasma::Theme::BackgroundColor);
}
QColor Theme::buttonTextColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonTextColor);
}
QColor Theme::buttonBackgroundColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonBackgroundColor);
}
QColor Theme::linkColor() const
{
return Plasma::Theme::color(Plasma::Theme::LinkColor);
}
QColor Theme::visitedLinkColor() const
{
return Plasma::Theme::color(Plasma::Theme::VisitedLinkColor);
}
QColor Theme::buttonHoverColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonHoverColor);
}
QColor Theme::buttonFocusColor() const
{
return Plasma::Theme::color(Plasma::Theme::ButtonFocusColor);
}
QColor Theme::viewTextColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewTextColor);
}
QColor Theme::viewBackgroundColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewBackgroundColor);
}
QColor Theme::viewHoverColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewHoverColor);
}
QColor Theme::viewFocusColor() const
{
return Plasma::Theme::color(Plasma::Theme::ViewFocusColor);
}
}

View File

@ -60,6 +60,22 @@ class PLASMA_EXPORT Theme : public QObject
Q_PROPERTY(QFont defaultFont READ defaultFont NOTIFY defaultFontChanged)
Q_PROPERTY(QFont smallestFont READ smallestFont NOTIFY smallestFontChanged)
// colors
Q_PROPERTY(QColor textColor READ textColor NOTIFY themeChanged)
Q_PROPERTY(QColor highlightColor READ highlightColor NOTIFY themeChanged)
Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonTextColor READ buttonTextColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY themeChanged)
Q_PROPERTY(QColor linkColor READ linkColor NOTIFY themeChanged)
Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChanged)
Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY themeChanged)
Q_PROPERTY(QColor buttonFocusColor READ buttonFocusColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewTextColor READ viewTextColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewBackgroundColor READ viewBackgroundColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewHoverColor READ viewHoverColor NOTIFY themeChanged)
Q_PROPERTY(QColor viewFocusColor READ viewFocusColor NOTIFY themeChanged)
public:
enum ColorRole {
TextColor = 0, /**< the text color to be used by items resting on the background */
@ -310,6 +326,21 @@ class PLASMA_EXPORT Theme : public QObject
QFont defaultFont() const;
QFont smallestFont() const;
QColor textColor() const;
QColor highlightColor() const;
QColor backgroundColor() const;
QColor buttonTextColor() const;
QColor buttonBackgroundColor() const;
QColor linkColor() const;
QColor visitedLinkColor() const;
QColor buttonHoverColor() const;
QColor buttonFocusColor() const;
QColor viewTextColor() const;
QColor viewBackgroundColor() const;
QColor viewHoverColor() const;
QColor viewFocusColor() const;
QString styleSheet() const;
Q_SIGNALS:
/**
* Emitted when the user changes the theme. Stylesheet usage, colors, etc. should