diff --git a/src/declarativeimports/core/CMakeLists.txt b/src/declarativeimports/core/CMakeLists.txt index e3d2f4e7c..9aba91920 100644 --- a/src/declarativeimports/core/CMakeLists.txt +++ b/src/declarativeimports/core/CMakeLists.txt @@ -24,6 +24,7 @@ set(corebindings_SRCS svgitem.cpp fadingnode.cpp framesvgitem.cpp + quicktheme.cpp tooltip.cpp tooltipdialog.cpp serviceoperationstatus.cpp diff --git a/src/declarativeimports/core/corebindingsplugin.cpp b/src/declarativeimports/core/corebindingsplugin.cpp index ebd9fd73a..fde046453 100644 --- a/src/declarativeimports/core/corebindingsplugin.cpp +++ b/src/declarativeimports/core/corebindingsplugin.cpp @@ -39,6 +39,7 @@ #include "iconitem.h" #include "serviceoperationstatus.h" #include "colorscope.h" +#include "quicktheme.h" #include "tooltip.h" #include "units.h" @@ -55,7 +56,7 @@ void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) QQmlContext *context = engine->rootContext(); - Plasma::Theme *theme = new Plasma::Theme(engine); + Plasma::QuickTheme *theme = new Plasma::QuickTheme(engine); context->setContextProperty("theme", theme); Units *units = new Units(context); @@ -81,7 +82,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 0, "FrameSvgItem"); //qmlRegisterType(uri, 2, 0, "Theme"); - qmlRegisterUncreatableType(uri, 2, 0, "Theme", "It is not possible to instantiate Theme directly."); + qmlRegisterUncreatableType(uri, 2, 0, "Theme", "It is not possible to instantiate Theme directly."); qmlRegisterType(uri, 2, 0, "ColorScope"); qmlRegisterType(uri, 2, 0, "DataSource"); diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index c19380756..ba4e9e8c0 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -467,91 +467,6 @@ 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::TextColor, Plasma::Theme::ButtonColorGroup); -} - -QColor Theme::buttonBackgroundColor() const -{ - return Plasma::Theme::color(Plasma::Theme::BackgroundColor, Plasma::Theme::ButtonColorGroup); -} - -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::HoverColor, Plasma::Theme::ButtonColorGroup); -} - -QColor Theme::buttonFocusColor() const -{ - return Plasma::Theme::color(Plasma::Theme::FocusColor, Plasma::Theme::ButtonColorGroup); -} - -QColor Theme::viewTextColor() const -{ - return Plasma::Theme::color(Plasma::Theme::TextColor, Plasma::Theme::ViewColorGroup); -} - -QColor Theme::viewBackgroundColor() const -{ - return Plasma::Theme::color(Plasma::Theme::BackgroundColor, Plasma::Theme::ViewColorGroup); -} - -QColor Theme::viewHoverColor() const -{ - return Plasma::Theme::color(Plasma::Theme::HoverColor, Plasma::Theme::ViewColorGroup); -} - -QColor Theme::viewFocusColor() const -{ - return Plasma::Theme::color(Plasma::Theme::FocusColor, Plasma::Theme::ViewColorGroup); -} - -QColor Theme::complementaryTextColor() const -{ - return Plasma::Theme::color(Plasma::Theme::TextColor, Plasma::Theme::ComplementaryColorGroup); -} - -QColor Theme::complementaryBackgroundColor() const -{ - return Plasma::Theme::color(Plasma::Theme::BackgroundColor, Plasma::Theme::ComplementaryColorGroup); -} - -QColor Theme::complementaryHoverColor() const -{ - return Plasma::Theme::color(Plasma::Theme::HoverColor, Plasma::Theme::ComplementaryColorGroup); -} - -QColor Theme::complementaryFocusColor() const -{ - return Plasma::Theme::color(Plasma::Theme::FocusColor, Plasma::Theme::ComplementaryColorGroup); -} - QSizeF Theme::mSize(const QFont &font) const { return QFontMetrics(font).boundingRect("M").size(); diff --git a/src/plasma/theme.h b/src/plasma/theme.h index 0211f7321..3f497198f 100644 --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -65,27 +65,6 @@ class PLASMA_EXPORT Theme : public QObject // stylesheet Q_PROPERTY(QString styleSheet READ styleSheet NOTIFY themeChanged) - // 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(QColor complementaryTextColor READ complementaryTextColor NOTIFY themeChanged) - Q_PROPERTY(QColor complementaryBackgroundColor READ complementaryBackgroundColor NOTIFY themeChanged) - Q_PROPERTY(QColor complementaryHoverColor READ viewHoverColor NOTIFY themeChanged) - Q_PROPERTY(QColor complementaryFocusColor READ viewFocusColor NOTIFY themeChanged) - public: enum ColorRole { TextColor = 0, /**< the text color to be used by items resting on the background */ @@ -349,108 +328,6 @@ public: */ QFont smallestFont() const; - /** - * @return The theme's colorscheme's text color - * @since 5.0 - */ - QColor textColor() const; - - /** - * @return The theme's colorscheme's highlight color - * @since 5.0 - */ - QColor highlightColor() const; - - /** - * @return The theme's colorscheme's background color - * @since 5.0 - */ - QColor backgroundColor() const; - - /** - * @return The theme's colorscheme's color for text on buttons - * @since 5.0 - */ - QColor buttonTextColor() const; - - /** - * @return The theme's colorscheme's background color color of buttons - * @since 5.0 - */ - QColor buttonBackgroundColor() const; - - /** - * @return The theme's colorscheme's link color - * @since 5.0 - */ - QColor linkColor() const; - - /** - * @return The theme's colorscheme's text color for visited links - * @since 5.0 - */ - QColor visitedLinkColor() const; - - /** - * @return The theme's colorscheme's color of hovered buttons - * @since 5.0 - */ - QColor buttonHoverColor() const; - - /** - * @return The theme's colorscheme's color of focused buttons - * @since 5.0 - */ - QColor buttonFocusColor() const; - - /** - * @return The theme's colorscheme's text color in views - * @since 5.0 - */ - QColor viewTextColor() const; - - /** - * @return The theme's colorscheme's background color of views - * @since 5.0 - */ - QColor viewBackgroundColor() const; - - /** - * @return The theme's colorscheme's color of hovered views - * @since 5.0 - */ - QColor viewHoverColor() const; - - /** - * @return The theme's colorscheme's color of focused views - * @since 5.0 - */ - QColor viewFocusColor() const; - - /** - * @return The theme's colorscheme's text color of "complementary" areas - * @since 5.0 - */ - QColor complementaryTextColor() const; - - /** - * @return The theme's colorscheme's background color of "complementary" areas - * @since 5.0 - */ - QColor complementaryBackgroundColor() const; - - /** - * @return The theme's colorscheme's color of hovered "complementary" areas - * @since 5.0 - */ - QColor complementaryHoverColor() const; - - /** - * @return The theme's colorscheme's color of focused "complementary" areas - * @since 5.0 - */ - QColor complementaryFocusColor() const; - /** This method allows Plasma to enable and disable the background * contrast effect for a given theme, improving readability. The * value is read from the "enabled" key in the "ContrastEffect"