From 61e9b10f95ba7011cf27b3e7c6e382a5d1a536a6 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 20 Oct 2019 09:59:40 +0300 Subject: [PATCH] fix advanced switch button state --improve how advanced settings state is triggered/changed BUG:411624 --- .../configuration/LatteDockConfiguration.qml | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index 3b3591c0e..4cc7aee6c 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -361,14 +361,6 @@ FocusScope { Layout.rightMargin: units.smallSpacing * 2 Layout.alignment: Qt.AlignRight | Qt.AlignTop - function switchMode() { - if (dialog.basicLevel || dialog.advancedLevel) { - viewConfig.complexity = Latte.Types.ExpertSettings; - } else if (dialog.expertLevel) { - viewConfig.complexity = Latte.Types.BasicSettings; - } - } - PlasmaComponents.Label { Layout.fillWidth: true Layout.alignment: Qt.AlignRight @@ -410,18 +402,20 @@ FocusScope { anchors.fill: parent hoverEnabled: true onClicked: { - complexitySettings.switchMode(); + complexitySwitch.checked = !complexitySwitch.checked; } } } LatteComponents.Switch { id: complexitySwitch - checked: dialog.expertLevel + checked: (viewConfig.complexity === Latte.Types.ExpertSettings) - onPressedChanged: { - if(pressed){ - complexitySettings.switchMode(); + onCheckedChanged: { + if (checked) { + viewConfig.complexity = Latte.Types.ExpertSettings; + } else { + viewConfig.complexity = Latte.Types.BasicSettings; } } }