add DisabledTextColor to Theme

This commit is contained in:
Marco Martin 2019-10-29 11:28:29 +01:00
parent 12edce87bb
commit 5f46dd6bd5
4 changed files with 16 additions and 1 deletions

View File

@ -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);

View File

@ -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

View File

@ -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();

View File

@ -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 {