From 5f46dd6bd52a2aac7f879eb7f14d26dc2cab5e3c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 29 Oct 2019 11:28:29 +0100 Subject: [PATCH] add DisabledTextColor to Theme --- src/declarativeimports/core/quicktheme.cpp | 5 +++++ src/declarativeimports/core/quicktheme.h | 7 +++++++ src/plasma/private/theme_p.cpp | 2 ++ src/plasma/theme.h | 3 ++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/declarativeimports/core/quicktheme.cpp b/src/declarativeimports/core/quicktheme.cpp index 2899cd42b..ef31e3eab 100644 --- a/src/declarativeimports/core/quicktheme.cpp +++ b/src/declarativeimports/core/quicktheme.cpp @@ -64,6 +64,11 @@ QColor QuickTheme::negativeTextColor() const return Plasma::Theme::color(Plasma::Theme::NegativeTextColor); } +QColor QuickTheme::disabledTextColor() const +{ + return Plasma::Theme::color(Plasma::Theme::DisabledTextColor); +} + QColor QuickTheme::backgroundColor() const { return Plasma::Theme::color(Plasma::Theme::BackgroundColor); diff --git a/src/declarativeimports/core/quicktheme.h b/src/declarativeimports/core/quicktheme.h index ec55c6f37..72efed7f8 100644 --- a/src/declarativeimports/core/quicktheme.h +++ b/src/declarativeimports/core/quicktheme.h @@ -56,6 +56,7 @@ class QuickTheme : public Plasma::Theme Q_PROPERTY(QColor positiveTextColor READ positiveTextColor NOTIFY themeChangedProxy) Q_PROPERTY(QColor neutralTextColor READ neutralTextColor NOTIFY themeChangedProxy) Q_PROPERTY(QColor negativeTextColor READ negativeTextColor NOTIFY themeChangedProxy) + Q_PROPERTY(QColor disabledTextColor READ disabledTextColor NOTIFY themeChangedProxy) Q_PROPERTY(QColor buttonTextColor READ buttonTextColor NOTIFY themeChangedProxy) Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY themeChangedProxy) @@ -126,6 +127,12 @@ public: */ QColor negativeTextColor() const; + /** + * @return The theme's colorscheme's disabled text color + * @since 5.64 + */ + QColor disabledTextColor() const; + /** * @return The theme's colorscheme's background color * @since 5.0 diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index 5d050755a..67fecc6bc 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -692,6 +692,8 @@ QColor ThemePrivate::color(Theme::ColorRole role, Theme::ColorGroup group) const return scheme->foreground(KColorScheme::NeutralText).color(); case Theme::NegativeTextColor: return scheme->foreground(KColorScheme::NegativeText).color(); + case Theme::DisabledTextColor: + return scheme->foreground(KColorScheme::InactiveText).color(); } return QColor(); diff --git a/src/plasma/theme.h b/src/plasma/theme.h index 441e28fe5..c65b8094d 100644 --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -78,7 +78,8 @@ public: HighlightedTextColor = 7,/**< color contrasting with HighlightColor, to be used for instance with */ PositiveTextColor = 8, /**< color of foreground objects with a "positive message" connotation (usually green) */ NeutralTextColor = 9, /**< color of foreground objects with a "neutral message" connotation (usually yellow) */ - NegativeTextColor = 10 /**< color of foreground objects with a "negative message" connotation (usually red) */ + NegativeTextColor = 10, /**< color of foreground objects with a "negative message" connotation (usually red) */ + DisabledTextColor = 11 /**< color of disabled text @since 5.64 */ }; enum ColorGroup {