Port Plasma Style Kirigami Theme plugin to new Kirigami API

This commit is contained in:
Arjen Hiemstra 2021-02-08 15:10:54 +01:00
parent c9bb42b2e4
commit e1c784dfa4

View File

@ -8,66 +8,71 @@ pragma Singleton
import QtQuick 2.4 import QtQuick 2.4
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.2 as Kirigami import org.kde.kirigami 2.16 as Kirigami
QtObject { Kirigami.BasicThemeDefinition {
property color textColor: theme.textColor textColor: theme.textColor
property color disabledTextColor: Qt.rgba(theme.textColor.r, theme.textColor.g, theme.textColor.b, 0.6) disabledTextColor: Qt.rgba(theme.textColor.r, theme.textColor.g, theme.textColor.b, 0.6)
highlightColor: theme.highlightColor
highlightedTextColor: theme.highlightedTextColor
backgroundColor: theme.backgroundColor
alternateBackgroundColor: Qt.darker(theme.backgroundColor, 1.05)
focusColor: theme.highlightColor
hoverColor: theme.highlightColor
property color highlightColor: theme.highlightColor
property color highlightedTextColor: theme.highlightedTextColor
property color backgroundColor: theme.backgroundColor
property color alternateBackgroundColor: Qt.darker(theme.backgroundColor, 1.05)
//TODO: don't make this invisible //TODO: don't make this invisible
property color activeTextColor: theme.highlightColor activeTextColor: theme.highlightColor
property color linkColor: theme.linkColor linkColor: theme.linkColor
property color visitedLinkColor: theme.visitedLinkColor visitedLinkColor: theme.visitedLinkColor
property color negativeTextColor: theme.negativeTextColor negativeTextColor: theme.negativeTextColor
property color neutralTextColor: theme.neutralTextColor neutralTextColor: theme.neutralTextColor
property color positiveTextColor: theme.positiveTextColor positiveTextColor: theme.positiveTextColor
property color buttonTextColor: theme.buttonTextColor buttonTextColor: theme.buttonTextColor
property color buttonBackgroundColor: theme.buttonBackgroundColor buttonBackgroundColor: theme.buttonBackgroundColor
property color buttonAlternateBackgroundColor: Qt.darker(theme.buttonBackgroundColor, 1.05) buttonAlternateBackgroundColor: Qt.darker(theme.buttonBackgroundColor, 1.05)
property color buttonHoverColor: theme.buttonHoverColor buttonHoverColor: theme.buttonHoverColor
property color buttonFocusColor: theme.buttonFocusColor buttonFocusColor: theme.buttonFocusColor
property color viewTextColor: theme.viewTextColor viewTextColor: theme.viewTextColor
property color viewBackgroundColor: theme.viewBackgroundColor viewBackgroundColor: theme.viewBackgroundColor
property color viewAlternateBackgroundColor: Qt.darker(theme.viewBackgroundColor, 1.05) viewAlternateBackgroundColor: Qt.darker(theme.viewBackgroundColor, 1.05)
property color viewHoverColor: theme.viewHoverColor viewHoverColor: theme.viewHoverColor
property color viewFocusColor: theme.viewFocusColor viewFocusColor: theme.viewFocusColor
property color selectionTextColor: theme.highlightedTextColor selectionTextColor: theme.highlightedTextColor
property color selectionBackgroundColor: theme.highlightColor selectionBackgroundColor: theme.highlightColor
property color selectionAlternateBackgroundColor: Qt.darker(theme.highlightColor, 1.05) selectionAlternateBackgroundColor: Qt.darker(theme.highlightColor, 1.05)
property color selectionHoverColor: theme.buttonHoverColor selectionHoverColor: theme.buttonHoverColor
property color selectionFocusColor: theme.buttonFocusColor selectionFocusColor: theme.buttonFocusColor
property color tooltipTextColor: theme.complementaryTextColor tooltipTextColor: theme.complementaryTextColor
property color tooltipBackgroundColor: theme.complementaryBackgroundColor tooltipBackgroundColor: theme.complementaryBackgroundColor
property color tooltipAlternateBackgroundColor: Qt.darker(theme.complementaryBackgroundColor, 1.05) tooltipAlternateBackgroundColor: Qt.darker(theme.complementaryBackgroundColor, 1.05)
property color tooltipHoverColor: theme.complementaryHoverColor tooltipHoverColor: theme.complementaryHoverColor
property color tooltipFocusColor: theme.complementaryFocusColor tooltipFocusColor: theme.complementaryFocusColor
property color complementaryTextColor: theme.complementaryTextColor complementaryTextColor: theme.complementaryTextColor
property color complementaryBackgroundColor: theme.complementaryBackgroundColor complementaryBackgroundColor: theme.complementaryBackgroundColor
property color complementaryAlternateBackgroundColor: Qt.darker(theme.complementaryBackgroundColor, 1.05) complementaryAlternateBackgroundColor: Qt.darker(theme.complementaryBackgroundColor, 1.05)
property color complementaryHoverColor: theme.complementaryHoverColor complementaryHoverColor: theme.complementaryHoverColor
property color complementaryFocusColor: theme.complementaryFocusColor complementaryFocusColor: theme.complementaryFocusColor
property color headerTextColor: theme.headerTextColor headerTextColor: theme.headerTextColor
property color headerBackgroundColor: theme.headerBackgroundColor headerBackgroundColor: theme.headerBackgroundColor
property color headerAlternateBackgroundColor: Qt.darker(theme.headerBackgroundColor, 1.05) headerAlternateBackgroundColor: Qt.darker(theme.headerBackgroundColor, 1.05)
property color headerHoverColor: theme.headerHoverColor headerHoverColor: theme.headerHoverColor
property color headerFocusColor: theme.headerFocusColor headerFocusColor: theme.headerFocusColor
property variant defaultFont: theme.defaultFont defaultFont: theme.defaultFont
property variant smallFont: theme.smallestFont smallFont: theme.smallestFont
function __propagateColorSet(object, context) { onSync: {
object.PlasmaCore.ColorScope.inherit = false; object.PlasmaCore.ColorScope.inherit = false
switch(context) {
switch (object.Kirigami.Theme.colorSet) {
case Kirigami.Theme.Window: case Kirigami.Theme.Window:
object.PlasmaCore.ColorScope.colorGroup = PlasmaCore.Theme.NormalColorGroup; object.PlasmaCore.ColorScope.colorGroup = PlasmaCore.Theme.NormalColorGroup;
break; break;
@ -91,8 +96,4 @@ QtObject {
break; break;
} }
} }
function __propagateTextColor(object, color) {}
function __propagateBackgroundColor(object, color) {}
function __propagatePrimaryColor(object, color) {}
function __propagateAccentColor(object, color) {}
} }