From 08feca1f6859ec8a643173a8760d37d3df352ec8 Mon Sep 17 00:00:00 2001 From: Filip Fila Date: Mon, 11 Mar 2019 01:41:40 +0100 Subject: [PATCH] [appmenu] Port configuration window to QQC2 and Kirigami.FormLayout Summary: This patch ports global menu's configuration window to QQC2 and Kirigami.FormLayout. It also changed the category icon to be consistent with other applets. Test Plan: Before: {F6682666} After: {F6682667} Reviewers: #plasma, #vdg, ngraham Reviewed By: #vdg, ngraham Subscribers: abetts, ngraham, plasma-devel Tags: #plasma Maniphest Tasks: T10586 Differential Revision: https://phabricator.kde.org/D19670 --- .../package/contents/config/config.qml | 2 +- .../package/contents/ui/configGeneral.qml | 29 ++++++------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/applets/appmenu/package/contents/config/config.qml b/applets/appmenu/package/contents/config/config.qml index de9440301..782e9ad3e 100644 --- a/applets/appmenu/package/contents/config/config.qml +++ b/applets/appmenu/package/contents/config/config.qml @@ -26,7 +26,7 @@ import org.kde.plasma.configuration 2.0 ConfigModel { ConfigCategory { name: i18n("Appearance") - icon: "plasma" + icon: "preferences-desktop-color" source: "configGeneral.qml" } } diff --git a/applets/appmenu/package/contents/ui/configGeneral.qml b/applets/appmenu/package/contents/ui/configGeneral.qml index 4e09e3497..fe78c2177 100644 --- a/applets/appmenu/package/contents/ui/configGeneral.qml +++ b/applets/appmenu/package/contents/ui/configGeneral.qml @@ -19,40 +19,29 @@ **********************************************************************/ import QtQuick 2.0 -import QtQuick.Controls 1.0 as Controls -import QtQuick.Layouts 1.1 as Layouts +import QtQuick.Controls 2.5 +import org.kde.kirigami 2.5 as Kirigami import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -Layouts.ColumnLayout { - id: configGeneral - +Kirigami.FormLayout { + anchors.left: parent.left + anchors.right: parent.right + property alias cfg_compactView: compactViewRadioButton.checked - property bool disableSetting: plasmoid.formFactor === PlasmaCore.Types.Vertical - Controls.ExclusiveGroup { - id: viewOptionGroup - } - - Controls.RadioButton { + RadioButton { id: compactViewRadioButton enabled: !disableSetting text: i18n("Use single button for application menu") - exclusiveGroup: viewOptionGroup } - Controls.RadioButton { + + RadioButton { id: fullViewRadioButton - //this checked binding is just for the initial load in case - //compactViewCheckBox is not checked. Then exclusive group manages it enabled: !disableSetting checked: !compactViewRadioButton.checked text: i18n("Show full application menu") - exclusiveGroup: viewOptionGroup - } - - Item { - Layouts.Layout.fillHeight: true } }