From 3aa8c0782bc419d0a22bd3b27c9a4f2061e644d3 Mon Sep 17 00:00:00 2001 From: Luis Bocanegra Date: Thu, 26 Sep 2024 17:15:23 -0600 Subject: [PATCH] fix: settings crash due to binding on buttons with custom colors refs: https://github.com/luisbocanegra/plasma-smart-video-wallpaper-reborn/issues/43 --- package/contents/ui/components/FormBorder.qml | 2 +- package/contents/ui/components/FormColors.qml | 2 +- package/contents/ui/components/FormShadow.qml | 2 +- package/contents/ui/components/FormShape.qml | 4 ++-- package/contents/ui/components/Header.qml | 3 ++- package/contents/ui/components/ValueMouseControl.qml | 2 +- package/contents/ui/components/WidgetCardCheck.qml | 4 ++-- package/contents/ui/components/WidgetCardConfig.qml | 4 ++-- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package/contents/ui/components/FormBorder.qml b/package/contents/ui/components/FormBorder.qml index 505beca..22a0371 100644 --- a/package/contents/ui/components/FormBorder.qml +++ b/package/contents/ui/components/FormBorder.qml @@ -37,7 +37,7 @@ Kirigami.FormLayout { Binding { target: enabledCheckbox property: "Kirigami.Theme.textColor" - value: Kirigami.Theme.neutralTextColor + value: borderRoot.Kirigami.Theme.neutralTextColor when: !enabledCheckbox.checked } Kirigami.Theme.inherit: false diff --git a/package/contents/ui/components/FormColors.qml b/package/contents/ui/components/FormColors.qml index 141464b..30209aa 100644 --- a/package/contents/ui/components/FormColors.qml +++ b/package/contents/ui/components/FormColors.qml @@ -171,7 +171,7 @@ Kirigami.FormLayout { Binding { target: enabledCheckbox property: "Kirigami.Theme.textColor" - value: Kirigami.Theme.neutralTextColor + value: colorRoot.Kirigami.Theme.neutralTextColor when: !enabledCheckbox.checked } Kirigami.Theme.inherit: false diff --git a/package/contents/ui/components/FormShadow.qml b/package/contents/ui/components/FormShadow.qml index 7f216e2..bc59d7a 100644 --- a/package/contents/ui/components/FormShadow.qml +++ b/package/contents/ui/components/FormShadow.qml @@ -41,7 +41,7 @@ Kirigami.FormLayout { Binding { target: enabledCheckbox property: "Kirigami.Theme.textColor" - value: Kirigami.Theme.neutralTextColor + value: shadowRoot.Kirigami.Theme.neutralTextColor when: !enabledCheckbox.checked } Kirigami.Theme.inherit: false diff --git a/package/contents/ui/components/FormShape.qml b/package/contents/ui/components/FormShape.qml index 91cda3a..61048dc 100644 --- a/package/contents/ui/components/FormShape.qml +++ b/package/contents/ui/components/FormShape.qml @@ -38,7 +38,7 @@ Kirigami.FormLayout { Binding { target: radiusEnabledCheckbox property: "Kirigami.Theme.textColor" - value: Kirigami.Theme.neutralTextColor + value: shapeRoot.Kirigami.Theme.neutralTextColor when: !radiusEnabledCheckbox.checked } Kirigami.Theme.inherit: false @@ -107,7 +107,7 @@ Kirigami.FormLayout { Binding { target: marginEnabledCheckbox property: "Kirigami.Theme.textColor" - value: Kirigami.Theme.neutralTextColor + value: shapeRoot.Kirigami.Theme.neutralTextColor when: !marginEnabledCheckbox.checked } Kirigami.Theme.inherit: false diff --git a/package/contents/ui/components/Header.qml b/package/contents/ui/components/Header.qml index 1b39abe..776eb94 100644 --- a/package/contents/ui/components/Header.qml +++ b/package/contents/ui/components/Header.qml @@ -6,6 +6,7 @@ import org.kde.plasma.plasmoid import org.kde.kirigami as Kirigami RowLayout { + id: root property alias isEnabled: isEnabledCheckbox.checked RowLayout { Layout.alignment: Qt.AlignRight @@ -17,7 +18,7 @@ RowLayout { Binding { target: isEnabledCheckbox property: "Kirigami.Theme.textColor" - value: Kirigami.Theme.neutralTextColor + value: root.Kirigami.Theme.neutralTextColor when: !isEnabledCheckbox.checked } Kirigami.Theme.inherit: false diff --git a/package/contents/ui/components/ValueMouseControl.qml b/package/contents/ui/components/ValueMouseControl.qml index 2df8e92..0c868eb 100644 --- a/package/contents/ui/components/ValueMouseControl.qml +++ b/package/contents/ui/components/ValueMouseControl.qml @@ -12,7 +12,7 @@ Item { Rectangle { anchors.fill: parent - Kirigami.Theme.colorSet: Kirigami.Theme.Button + Kirigami.Theme.colorSet: root.Kirigami.Theme.Button Kirigami.Theme.inherit: false color: Kirigami.Theme.backgroundColor opacity: 1 diff --git a/package/contents/ui/components/WidgetCardCheck.qml b/package/contents/ui/components/WidgetCardCheck.qml index 1790b65..493cc4a 100644 --- a/package/contents/ui/components/WidgetCardCheck.qml +++ b/package/contents/ui/components/WidgetCardCheck.qml @@ -23,7 +23,7 @@ Kirigami.AbstractCard { Rectangle { visible: widget.inTray color: Kirigami.Theme.highlightColor - Kirigami.Theme.colorSet: Kirigami.Theme["Selection"] + Kirigami.Theme.colorSet: root.Kirigami.Theme["Selection"] radius: parent.height / 2 width: label.width + 12 height: label.height + 2 @@ -33,7 +33,7 @@ Kirigami.AbstractCard { id: label text: "Tray" color: Kirigami.Theme.textColor - Kirigami.Theme.colorSet: Kirigami.Theme["Selection"] + Kirigami.Theme.colorSet: root.Kirigami.Theme["Selection"] Kirigami.Theme.inherit: false } } diff --git a/package/contents/ui/components/WidgetCardConfig.qml b/package/contents/ui/components/WidgetCardConfig.qml index 4a73f6c..192b551 100644 --- a/package/contents/ui/components/WidgetCardConfig.qml +++ b/package/contents/ui/components/WidgetCardConfig.qml @@ -27,7 +27,7 @@ Kirigami.AbstractCard { Rectangle { visible: widget.inTray color: Kirigami.Theme.highlightColor - Kirigami.Theme.colorSet: Kirigami.Theme["Selection"] + Kirigami.Theme.colorSet: root.Kirigami.Theme["Selection"] radius: parent.height / 2 width: label.width + 12 height: label.height + 2 @@ -37,7 +37,7 @@ Kirigami.AbstractCard { id: label text: "Tray" color: Kirigami.Theme.textColor - Kirigami.Theme.colorSet: Kirigami.Theme["Selection"] + Kirigami.Theme.colorSet: root.Kirigami.Theme["Selection"] Kirigami.Theme.inherit: false } }