From d719f407dd726956002e7b7d970d7b22371b4d30 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 5 Sep 2023 16:18:47 +0000 Subject: [PATCH] Port away from using colorGroup property directly in svg items SvgItem and FrameSvgItem automatically follow the colorSet of Kirigami.Theme and to set a custom one the usual inherit api is used https://invent.kde.org/frameworks/ksvg/-/merge_requests/22 removes those properties --- .../qml/navigationpanel/NavigationPanel.qml | 12 ++++++++---- .../qml/navigationpanel/NavigationPanelButton.qml | 1 - .../package/contents/ui/private/ScrollIndicator.qml | 9 +++++---- .../package/contents/ui/NavigationPanelComponent.qml | 2 +- kwin/mobiletaskswitcher/qml/TaskSwitcher.qml | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml index a7710901..4131d23d 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml @@ -59,7 +59,8 @@ Item { NavigationPanelButton { id: leftButton visible: root.leftAction.visible - colorGroup: root.foregroundColorGroup + Kirigami.Theme.colorSet: root.foregroundColorGroup + Kirigami.Theme.inherit: false enabled: root.leftAction.enabled iconSizeFactor: root.leftAction.iconSizeFactor iconSource: root.leftAction.iconSource @@ -74,7 +75,8 @@ Item { id: middleButton anchors.centerIn: parent visible: root.middleAction.visible - colorGroup: root.foregroundColorGroup + Kirigami.Theme.colorSet: root.foregroundColorGroup + Kirigami.Theme.inherit: false enabled: root.middleAction.enabled iconSizeFactor: root.middleAction.iconSizeFactor iconSource: root.middleAction.iconSource @@ -88,7 +90,8 @@ Item { NavigationPanelButton { id: rightButton visible: root.rightAction.visible - colorGroup: root.foregroundColorGroup + Kirigami.Theme.colorSet: root.foregroundColorGroup + Kirigami.Theme.inherit: false enabled: root.rightAction.enabled iconSizeFactor: root.rightAction.iconSizeFactor iconSource: root.rightAction.iconSource @@ -102,7 +105,8 @@ Item { NavigationPanelButton { id: rightCornerButton visible: root.rightCornerAction.visible - colorGroup: root.foregroundColorGroup + Kirigami.Theme.colorSet: root.foregroundColorGroup + Kirigami.Theme.inherit: false enabled: root.rightCornerAction.enabled iconSizeFactor: root.rightCornerAction.iconSizeFactor iconSource: root.rightCornerAction.iconSource diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml b/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml index 3c493c27..097e4374 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml @@ -20,7 +20,6 @@ Controls.AbstractButton { property double iconSizeFactor: 1 property alias iconSource: icon.source - property alias colorGroup: icon.colorGroup Rectangle { id: rect diff --git a/containments/homescreens/folio/package/contents/ui/private/ScrollIndicator.qml b/containments/homescreens/folio/package/contents/ui/private/ScrollIndicator.qml index 56dc3e72..594ba3fa 100644 --- a/containments/homescreens/folio/package/contents/ui/private/ScrollIndicator.qml +++ b/containments/homescreens/folio/package/contents/ui/private/ScrollIndicator.qml @@ -16,10 +16,11 @@ KSvg.SvgItem { z: 2 opacity: 0 - svg: KSvg.Svg { - imagePath: "widgets/arrows" - colorGroup: Kirigami.Theme.ComplementaryColorGroup - } + + Kirigami.Theme.colorSet: Kirigami.Theme.Complementary + Kirigami.Theme.inherit: false + + imagePath: "widgets/arrows" elementId: "left-arrow" width: Kirigami.Units.iconSizes.large height: width diff --git a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml index a4bab351..58e76f3c 100644 --- a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml +++ b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml @@ -25,7 +25,7 @@ MobileShell.NavigationPanel { // - translucent if the task switcher is open // - transparent if on the homescreen backgroundColor: (Keyboards.KWinVirtualKeyboard.visible || opaqueBar) ? Kirigami.Theme.backgroundColor : "transparent"; - foregroundColorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup + foregroundColorGroup: opaqueBar ? Kirigami.Theme.Window : Kirigami.Theme.Complementary shadow: !opaqueBar TaskManager.VirtualDesktopInfo { diff --git a/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml b/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml index f4c33b19..5b21f354 100644 --- a/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml +++ b/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml @@ -161,7 +161,7 @@ FocusScope { z: 1 visible: ShellSettings.Settings.navigationPanelEnabled backgroundColor: Qt.rgba(0, 0, 0, 0.1) - foregroundColorGroup: PlasmaCore.Theme.ComplementaryColorGroup + foregroundColorGroup: Kirigami.Theme.Complementary shadow: false leftAction: MobileShell.NavigationPanelAction {