diff --git a/src/declarativeimports/core/theme.cpp b/src/declarativeimports/core/theme.cpp index 454ea93f8..470ec1af2 100644 --- a/src/declarativeimports/core/theme.cpp +++ b/src/declarativeimports/core/theme.cpp @@ -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()); diff --git a/src/declarativeimports/core/theme.h b/src/declarativeimports/core/theme.h index e2912e907..2ee8d86f9 100644 --- a/src/declarativeimports/core/theme.h +++ b/src/declarativeimports/core/theme.h @@ -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; diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index 9f3b786e4..b6ce1baa8 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -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); +} } diff --git a/src/plasma/theme.h b/src/plasma/theme.h index 3367f0658..3831b4172 100644 --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -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