diff --git a/src/controls/Theme.qml b/src/controls/Theme.qml --- a/src/controls/Theme.qml +++ b/src/controls/Theme.qml @@ -57,13 +57,19 @@ property color highlightedTextColor: "#eff0fa" property color backgroundColor: "#eff0f1" property color alternateBackgroundColor: "#bdc3c7" + property color activeTextColor: "#0176D3" + property color activeBackgroundColor: "#0176D3" property color linkColor: "#2196F3" + property color linkBackgroundColor: "#2196F3" property color visitedLinkColor: "#2196F3" - + property color visitedLinkBackgroundColor: "#2196F3" property color negativeTextColor: "#DA4453" + property color negativeBackgroundColor: "#DA4453" property color neutralTextColor: "#F67400" + property color neutralBackgroundColor: "#F67400" property color positiveTextColor: "#27AE60" + property color positiveBackgroundColor: "#27AE60" property color buttonTextColor: "#31363b" property color buttonBackgroundColor: "#eff0f1" diff --git a/src/controls/plugins.qmltypes b/src/controls/plugins.qmltypes --- a/src/controls/plugins.qmltypes +++ b/src/controls/plugins.qmltypes @@ -130,6 +130,12 @@ Property { name: "positiveTextColor"; type: "QColor" } Property { name: "backgroundColor"; type: "QColor" } Property { name: "highlightColor"; type: "QColor" } + Property { name: "activeBackgroundColor"; type: "QColor" } + Property { name: "linkBackgroundColor"; type: "QColor" } + Property { name: "visitedLinkBackgroundColor"; type: "QColor" } + Property { name: "negativeBackgroundColor"; type: "QColor" } + Property { name: "neutralBackgroundColor"; type: "QColor" } + Property { name: "positiveBackgroundColor"; type: "QColor" } Property { name: "focusColor"; type: "QColor" } Property { name: "hoverColor"; type: "QColor" } Property { name: "defaultFont"; type: "QFont"; isReadonly: true } @@ -1816,13 +1822,19 @@ Property { name: "highlightedTextColor"; type: "QColor" } Property { name: "backgroundColor"; type: "QColor" } Property { name: "activeTextColor"; type: "QColor" } + Property { name: "activeBackgroundColor"; type: "QColor" } Property { name: "linkColor"; type: "QColor" } + Property { name: "linkBackgroundColor"; type: "QColor" } Property { name: "visitedLinkColor"; type: "QColor" } + Property { name: "visitedLinkBackgroundColor"; type: "QColor" } Property { name: "hoverColor"; type: "QColor" } Property { name: "focusColor"; type: "QColor" } Property { name: "negativeTextColor"; type: "QColor" } + Property { name: "negativeBackgroundColor"; type: "QColor" } Property { name: "neutralTextColor"; type: "QColor" } + Property { name: "neutralBackgroundColor"; type: "QColor" } Property { name: "positiveTextColor"; type: "QColor" } + Property { name: "positiveBackgroundColor"; type: "QColor" } Property { name: "buttonTextColor"; type: "QColor" } Property { name: "buttonBackgroundColor"; type: "QColor" } Property { name: "buttonHoverColor"; type: "QColor" } diff --git a/src/libkirigami/basictheme.cpp b/src/libkirigami/basictheme.cpp --- a/src/libkirigami/basictheme.cpp +++ b/src/libkirigami/basictheme.cpp @@ -213,16 +213,28 @@ setHighlightedTextColor(PROXYCOLOR(highlightedTextColor, HighlightedTextColor)); }{ setActiveTextColor(PROXYCOLOR(activeTextColor, ActiveTextColor)); + }{ + setActiveBackgroundColor(PROXYCOLOR(activeBackgroundColor, ActiveBackgroundColor)); }{ setLinkColor(PROXYCOLOR(linkColor, LinkColor)); + }{ + setLinkBackgroundColor(PROXYCOLOR(linkBackgroundColor, LinkBackgroundColor)); }{ setVisitedLinkColor(PROXYCOLOR(visitedLinkColor, VisitedLinkColor)); + }{ + setVisitedLinkBackgroundColor(PROXYCOLOR(visitedLinkBackgroundColor, VisitedLinkBackgroundColor)); }{ setNegativeTextColor(PROXYCOLOR(negativeTextColor, NegativeTextColor)); + }{ + setNegativeBackgroundColor(PROXYCOLOR(negativeBackgroundColor, NegativeBackgroundColor)); }{ setNeutralTextColor(PROXYCOLOR(neutralTextColor, NeutralTextColor)); + }{ + setNeutralBackgroundColor(PROXYCOLOR(neutralBackgroundColor, NeutralBackgroundColor)); }{ setPositiveTextColor(PROXYCOLOR(positiveTextColor, PositiveTextColor)); + }{ + setPositiveBackgroundColor(PROXYCOLOR(positiveBackgroundColor, PositiveBackgroundColor)); }{ RESOLVECOLOR(hoverColor, HoverColor); setHoverColor(color); diff --git a/src/libkirigami/platformtheme.h b/src/libkirigami/platformtheme.h --- a/src/libkirigami/platformtheme.h +++ b/src/libkirigami/platformtheme.h @@ -137,6 +137,36 @@ */ Q_PROPERTY(QColor highlightColor READ highlightColor WRITE setCustomHighlightColor RESET setCustomHighlightColor NOTIFY colorsChanged) + /** + * Background for areas that are active or requesting attention + */ + Q_PROPERTY(QColor activeBackgroundColor READ activeBackgroundColor WRITE setCustomActiveBackgroundColor RESET setCustomActiveBackgroundColor NOTIFY colorsChanged) + + /** + * Background color for links + */ + Q_PROPERTY(QColor linkBackgroundColor READ linkBackgroundColor WRITE setCustomLinkBackgroundColor RESET setCustomLinkBackgroundColor NOTIFY colorsChanged) + + /** + * Background color for visited links, usually a bit darker than linkBackgroundColor + */ + Q_PROPERTY(QColor visitedLinkBackgroundColor READ visitedLinkBackgroundColor WRITE setCustomVisitedLinkBackgroundColor RESET setCustomVisitedLinkBackgroundColor NOTIFY colorsChanged) + + /** + * Background color for negative areas, such as critical errors and destructive actions + */ + Q_PROPERTY(QColor negativeBackgroundColor READ negativeBackgroundColor WRITE setCustomNegativeBackgroundColor RESET setCustomNegativeBackgroundColor NOTIFY colorsChanged) + + /** + * Background color for neutral areas, such as warnings (but not critical) + */ + Q_PROPERTY(QColor neutralBackgroundColor READ neutralBackgroundColor WRITE setCustomNeutralBackgroundColor RESET setCustomNeutralBackgroundColor NOTIFY colorsChanged) + + /** + * Background color for positive areas, such as success messages and trusted content + */ + Q_PROPERTY(QColor positiveBackgroundColor READ positiveBackgroundColor WRITE setCustomPositiveBackgroundColor RESET setCustomPositiveBackgroundColor NOTIFY colorsChanged) + //decoration colors /** * A decoration color that indicates active focus @@ -200,7 +230,12 @@ QColor backgroundColor() const; QColor alternateBackgroundColor() const; QColor highlightColor() const; - //TODO: add active/positive/neutral/negative backgrounds? + QColor activeBackgroundColor() const; + QColor linkBackgroundColor() const; + QColor visitedLinkBackgroundColor() const; + QColor negativeBackgroundColor() const; + QColor neutralBackgroundColor() const; + QColor positiveBackgroundColor() const; //decoration colors QColor focusColor() const; @@ -230,6 +265,12 @@ void setCustomBackgroundColor(const QColor &color = QColor()); void setCustomAlternateBackgroundColor(const QColor &color = QColor()); void setCustomHighlightColor(const QColor &color = QColor()); + void setCustomActiveBackgroundColor(const QColor &color = QColor()); + void setCustomLinkBackgroundColor(const QColor &color = QColor()); + void setCustomVisitedLinkBackgroundColor(const QColor &color = QColor()); + void setCustomNegativeBackgroundColor(const QColor &color = QColor()); + void setCustomNeutralBackgroundColor(const QColor &color = QColor()); + void setCustomPositiveBackgroundColor(const QColor &color = QColor()); //decoration colors void setCustomFocusColor(const QColor &color = QColor()); void setCustomHoverColor(const QColor &color = QColor()); @@ -265,6 +306,12 @@ void setBackgroundColor(const QColor &color); void setAlternateBackgroundColor(const QColor &color); void setHighlightColor(const QColor &color); + void setActiveBackgroundColor(const QColor &color); + void setLinkBackgroundColor(const QColor &color); + void setVisitedLinkBackgroundColor(const QColor &color); + void setNegativeBackgroundColor(const QColor &color); + void setNeutralBackgroundColor(const QColor &color); + void setPositiveBackgroundColor(const QColor &color); //decoration colors void setFocusColor(const QColor &color); diff --git a/src/libkirigami/platformtheme.cpp b/src/libkirigami/platformtheme.cpp --- a/src/libkirigami/platformtheme.cpp +++ b/src/libkirigami/platformtheme.cpp @@ -63,6 +63,12 @@ QColor backgroundColor; QColor alternateBackgroundColor; QColor highlightColor; + QColor activeBackgroundColor; + QColor linkBackgroundColor; + QColor visitedLinkBackgroundColor; + QColor negativeBackgroundColor; + QColor neutralBackgroundColor; + QColor positiveBackgroundColor; QColor focusColor; QColor hoverColor; @@ -83,6 +89,12 @@ QColor customBackgroundColor; QColor customAlternateBackgroundColor; QColor customHighlightColor; + QColor customActiveBackgroundColor; + QColor customLinkBackgroundColor; + QColor customVisitedLinkBackgroundColor; + QColor customNegativeBackgroundColor; + QColor customNeutralBackgroundColor; + QColor customPositiveBackgroundColor; QColor customFocusColor; QColor customHoverColor; @@ -161,6 +173,12 @@ q->setCustomBackgroundColor(t->d->customBackgroundColor); q->setCustomAlternateBackgroundColor(t->d->customAlternateBackgroundColor); q->setCustomHighlightColor(t->d->customHighlightColor); + q->setCustomActiveBackgroundColor(t->d->customActiveBackgroundColor); + q->setCustomLinkBackgroundColor(t->d->customLinkBackgroundColor); + q->setCustomVisitedLinkBackgroundColor(t->d->customVisitedLinkBackgroundColor); + q->setCustomNegativeBackgroundColor(t->d->customNegativeBackgroundColor); + q->setCustomNeutralBackgroundColor(t->d->customNeutralBackgroundColor); + q->setCustomPositiveBackgroundColor(t->d->customPositiveBackgroundColor); q->setCustomFocusColor(t->d->customFocusColor); q->setCustomHoverColor(t->d->customHoverColor); } @@ -324,31 +342,61 @@ return d->customActiveTextColor.isValid() ? d->customActiveTextColor : d->activeTextColor; } +QColor PlatformTheme::activeBackgroundColor() const +{ + return d->customActiveBackgroundColor.isValid() ? d->customActiveBackgroundColor : d->activeBackgroundColor; +} + QColor PlatformTheme::linkColor() const { return d->customLinkColor.isValid() ? d->customLinkColor : d->linkColor; } +QColor PlatformTheme::linkBackgroundColor() const +{ + return d->customLinkBackgroundColor.isValid() ? d->customLinkBackgroundColor : d->linkBackgroundColor; +} + QColor PlatformTheme::visitedLinkColor() const { return d->customVisitedLinkColor.isValid() ? d->customVisitedLinkColor : d->visitedLinkColor; } +QColor PlatformTheme::visitedLinkBackgroundColor() const +{ + return d->customVisitedLinkBackgroundColor.isValid() ? d->customVisitedLinkBackgroundColor : d->visitedLinkBackgroundColor; +} + QColor PlatformTheme::negativeTextColor() const { return d->customNegativeTextColor.isValid() ? d->customNegativeTextColor : d->negativeTextColor; } +QColor PlatformTheme::negativeBackgroundColor() const +{ + return d->customNegativeBackgroundColor.isValid() ? d->customNegativeBackgroundColor : d->negativeBackgroundColor; +} + QColor PlatformTheme::neutralTextColor() const { return d->customNeutralTextColor.isValid() ? d->customNeutralTextColor : d->neutralTextColor; } +QColor PlatformTheme::neutralBackgroundColor() const +{ + return d->customNeutralBackgroundColor.isValid() ? d->customNeutralBackgroundColor : d->neutralBackgroundColor; +} + QColor PlatformTheme::positiveTextColor() const { return d->customPositiveTextColor.isValid() ? d->customPositiveTextColor : d->positiveTextColor; } +QColor PlatformTheme::positiveBackgroundColor() const +{ + return d->customPositiveBackgroundColor.isValid() ? d->customPositiveBackgroundColor : d->positiveBackgroundColor; +} + QColor PlatformTheme::focusColor() const { return d->customFocusColor.isValid() ? d->customFocusColor : d->focusColor; @@ -430,6 +478,16 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setActiveBackgroundColor(const QColor &color) +{ + if (d->activeBackgroundColor == color) { + return; + } + + d->activeBackgroundColor = color; + d->emitCompressedColorChanged(); +} + void PlatformTheme::setLinkColor(const QColor &color) { if (d->linkColor == color) { @@ -440,6 +498,16 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setLinkBackgroundColor(const QColor &color) +{ + if (d->linkBackgroundColor == color) { + return; + } + + d->linkBackgroundColor = color; + d->emitCompressedColorChanged(); +} + void PlatformTheme::setVisitedLinkColor(const QColor &color) { if (d->visitedLinkColor == color) { @@ -450,6 +518,16 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setVisitedLinkBackgroundColor(const QColor &color) +{ + if (d->visitedLinkBackgroundColor == color) { + return; + } + + d->visitedLinkBackgroundColor = color; + d->emitCompressedColorChanged(); +} + void PlatformTheme::setNegativeTextColor(const QColor &color) { if (d->negativeTextColor == color) { @@ -460,6 +538,16 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setNegativeBackgroundColor(const QColor &color) +{ + if (d->negativeBackgroundColor == color) { + return; + } + + d->negativeBackgroundColor = color; + d->emitCompressedColorChanged(); +} + void PlatformTheme::setNeutralTextColor(const QColor &color) { if (d->neutralTextColor == color) { @@ -470,6 +558,16 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setNeutralBackgroundColor(const QColor &color) +{ + if (d->neutralBackgroundColor == color) { + return; + } + + d->neutralBackgroundColor = color; + d->emitCompressedColorChanged(); +} + void PlatformTheme::setPositiveTextColor(const QColor &color) { if (d->positiveTextColor == color) { @@ -480,6 +578,16 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setPositiveBackgroundColor(const QColor &color) +{ + if (d->positiveBackgroundColor == color) { + return; + } + + d->positiveBackgroundColor = color; + d->emitCompressedColorChanged(); +} + void PlatformTheme::setHoverColor(const QColor &color) { if (d->hoverColor == color) { @@ -602,6 +710,17 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setCustomActiveBackgroundColor(const QColor &color) +{ + if (d->customActiveBackgroundColor == color) { + return; + } + + d->customActiveBackgroundColor = color; + PROPAGATECUSTOMCOLOR(CustomActiveBackgroundColor, color) + d->emitCompressedColorChanged(); +} + void PlatformTheme::setCustomLinkColor(const QColor &color) { if (d->customLinkColor == color) { @@ -613,6 +732,17 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setCustomLinkBackgroundColor(const QColor &color) +{ + if (d->customLinkBackgroundColor == color) { + return; + } + + d->customLinkBackgroundColor = color; + PROPAGATECUSTOMCOLOR(CustomLinkBackgroundColor, color) + d->emitCompressedColorChanged(); +} + void PlatformTheme::setCustomVisitedLinkColor(const QColor &color) { if (d->customVisitedLinkColor == color) { @@ -624,6 +754,17 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setCustomVisitedLinkBackgroundColor(const QColor &color) +{ + if (d->customVisitedLinkBackgroundColor == color) { + return; + } + + d->customVisitedLinkBackgroundColor = color; + PROPAGATECUSTOMCOLOR(CustomVisitedLinkBackgroundColor, color) + d->emitCompressedColorChanged(); +} + void PlatformTheme::setCustomNegativeTextColor(const QColor &color) { if (d->customNegativeTextColor == color) { @@ -635,6 +776,17 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setCustomNegativeBackgroundColor(const QColor &color) +{ + if (d->customNegativeBackgroundColor == color) { + return; + } + + d->customNegativeBackgroundColor = color; + PROPAGATECUSTOMCOLOR(CustomNegativeBackgroundColor, color) + d->emitCompressedColorChanged(); +} + void PlatformTheme::setCustomNeutralTextColor(const QColor &color) { if (d->customNeutralTextColor == color) { @@ -646,6 +798,17 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setCustomNeutralBackgroundColor(const QColor &color) +{ + if (d->customNeutralBackgroundColor == color) { + return; + } + + d->customNeutralBackgroundColor = color; + PROPAGATECUSTOMCOLOR(CustomNeutralBackgroundColor, color) + d->emitCompressedColorChanged(); +} + void PlatformTheme::setCustomPositiveTextColor(const QColor &color) { if (d->customPositiveTextColor == color) { @@ -657,6 +820,17 @@ d->emitCompressedColorChanged(); } +void PlatformTheme::setCustomPositiveBackgroundColor(const QColor &color) +{ + if (d->customPositiveBackgroundColor == color) { + return; + } + + d->customPositiveBackgroundColor = color; + PROPAGATECUSTOMCOLOR(CustomPositiveBackgroundColor, color) + d->emitCompressedColorChanged(); +} + void PlatformTheme::setCustomHoverColor(const QColor &color) { if (d->customHoverColor == color) { diff --git a/src/styles/Material/Theme.qml b/src/styles/Material/Theme.qml --- a/src/styles/Material/Theme.qml +++ b/src/styles/Material/Theme.qml @@ -40,13 +40,19 @@ property color backgroundColor: theme.Material.background property color alternateBackgroundColor: Qt.darker(theme.Material.background, 1.05) property color activeTextColor: theme.Material.primary + property color activeBackgroundColor: theme.Material.primary property color linkColor: "#2980B9" + property color linkBackgroundColor: "#2980B9" property color visitedLinkColor: "#7F8C8D" + property color visitedLinkBackgroundColor: "#7F8C8D" property color hoverColor: theme.Material.highlightedButtonColor property color focusColor: theme.Material.highlightedButtonColor property color negativeTextColor: "#DA4453" + property color negativeBackgroundColor: "#DA4453" property color neutralTextColor: "#F67400" + property color neutralBackgroundColor: "#F67400" property color positiveTextColor: "#27AE60" + property color positiveBackgroundColor: "#27AE60" property color buttonTextColor: theme.Material.foreground property color buttonBackgroundColor: theme.Material.buttonColor diff --git a/src/styles/org.kde.desktop/Theme.qml b/src/styles/org.kde.desktop/Theme.qml --- a/src/styles/org.kde.desktop/Theme.qml +++ b/src/styles/org.kde.desktop/Theme.qml @@ -33,13 +33,19 @@ property color backgroundColor: palette.window property color alternateBackgroundColor: Qt.darker(palette.window, 1.05) property color activeTextColor: palette.highlight + property color activeBackgroundColor: palette.highlight property color linkColor: "#2980B9" + property color linkBackgroundColor: "#2980B9" property color visitedLinkColor: "#7F8C8D" + property color visitedLinkBackgroundColor: "#7F8C8D" property color hoverColor: palette.highlight property color focusColor: palette.highlight property color negativeTextColor: "#DA4453" + property color negativeBackgroundColor: "#DA4453" property color neutralTextColor: "#F67400" + property color neutralBackgroundColor: "#F67400" property color positiveTextColor: "#27AE60" + property color positiveBackgroundColor: "#27AE60" property color buttonTextColor: palette.buttonText property color buttonBackgroundColor: palette.button