From e6b5903fffab15ba881e9d540944deda02609a50 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 16 Jan 2019 15:16:40 +0000 Subject: [PATCH] [kcmkwin/kwindesktop] Remove pointless layout container Summary: ColumnLayout only contains one item so is rather pointless, but more importantly prevents size hints from the formLayout propogating up to the ScrollViewKCM. Test Plan: Opened KCM Reviewers: #kwin, broulik Reviewed By: broulik Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D18297 --- .../kwindesktop/package/contents/ui/main.qml | 210 +++++++++--------- 1 file changed, 103 insertions(+), 107 deletions(-) diff --git a/kcmkwin/kwindesktop/package/contents/ui/main.qml b/kcmkwin/kwindesktop/package/contents/ui/main.qml index 55b066bb09..27b4a56333 100644 --- a/kcmkwin/kwindesktop/package/contents/ui/main.qml +++ b/kcmkwin/kwindesktop/package/contents/ui/main.qml @@ -174,123 +174,119 @@ ScrollViewKCM { } } - footer: ColumnLayout { - Kirigami.FormLayout { - anchors.horizontalCenter: parent.horizontalCenter + footer: Kirigami.FormLayout { + Connections { + target: kcm - Connections { - target: kcm + onNavWrapsChanged: navWraps.checked = kcm.navWraps - onNavWrapsChanged: navWraps.checked = kcm.navWraps + onOsdEnabledChanged: osdEnabled.checked = kcm.osdEnabled + onOsdDurationChanged: osdDuration.value = kcm.osdDuration + onOsdTextOnlyChanged: osdTextOnly.checked = !kcm.osdTextOnly + } - onOsdEnabledChanged: osdEnabled.checked = kcm.osdEnabled - onOsdDurationChanged: osdDuration.value = kcm.osdDuration - onOsdTextOnlyChanged: osdTextOnly.checked = !kcm.osdTextOnly + QtControls.CheckBox { + id: navWraps + + Kirigami.FormData.label: i18n("Options:") + + text: i18n("Navigation wraps around") + + checked: kcm.navWraps + + onCheckedChanged: kcm.navWraps = checked + } + + RowLayout { + Layout.fillWidth: true + + QtControls.CheckBox { + id: animationEnabled + + text: i18n("Show animation when switching:") + + checked: kcm.animationsModel.enabled + + onCheckedChanged: kcm.animationsModel.enabled = checked + } + + QtControls.ComboBox { + enabled: animationEnabled.checked + + model: kcm.animationsModel + textRole: "NameRole" + currentIndex: kcm.animationsModel.currentIndex + onActivated: kcm.animationsModel.currentIndex = currentIndex + } + + QtControls.Button { + enabled: animationEnabled.checked && kcm.animationsModel.currentConfigurable + + icon.name: "configure" + + onClicked: kcm.configureAnimation() + } + + QtControls.Button { + enabled: animationEnabled.checked + + icon.name: "dialog-information" + + onClicked: kcm.showAboutAnimation() + } + + Item { + Layout.fillWidth: true + } + } + + RowLayout { + Layout.fillWidth: true + + QtControls.CheckBox { + id: osdEnabled + + text: i18n("Show on-screen display when switching:") + + checked: kcm.osdEnabled + + onToggled: kcm.osdEnabled = checked + } + + QtControls.SpinBox { + id: osdDuration + + enabled: osdEnabled.checked + + from: 0 + to: 10000 + stepSize: 100 + + textFromValue: function(value, locale) { return i18n("%1 ms", value)} + + value: kcm.osdDuration + + onValueChanged: kcm.osdDuration = value + } + } + + RowLayout { + Layout.fillWidth: true + + Item { + width: units.largeSpacing } QtControls.CheckBox { - id: navWraps + id: osdTextOnly - Kirigami.FormData.label: i18n("Options:") + enabled: osdEnabled.checked - text: i18n("Navigation wraps around") + text: i18n("Show desktop layout indicators") - checked: kcm.navWraps + checked: !kcm.osdTextOnly - onCheckedChanged: kcm.navWraps = checked - } - - RowLayout { - Layout.fillWidth: true - - QtControls.CheckBox { - id: animationEnabled - - text: i18n("Show animation when switching:") - - checked: kcm.animationsModel.enabled - - onCheckedChanged: kcm.animationsModel.enabled = checked - } - - QtControls.ComboBox { - enabled: animationEnabled.checked - - model: kcm.animationsModel - textRole: "NameRole" - currentIndex: kcm.animationsModel.currentIndex - onActivated: kcm.animationsModel.currentIndex = currentIndex - } - - QtControls.Button { - enabled: animationEnabled.checked && kcm.animationsModel.currentConfigurable - - icon.name: "configure" - - onClicked: kcm.configureAnimation() - } - - QtControls.Button { - enabled: animationEnabled.checked - - icon.name: "dialog-information" - - onClicked: kcm.showAboutAnimation() - } - - Item { - Layout.fillWidth: true - } - } - - RowLayout { - Layout.fillWidth: true - - QtControls.CheckBox { - id: osdEnabled - - text: i18n("Show on-screen display when switching:") - - checked: kcm.osdEnabled - - onToggled: kcm.osdEnabled = checked - } - - QtControls.SpinBox { - id: osdDuration - - enabled: osdEnabled.checked - - from: 0 - to: 10000 - stepSize: 100 - - textFromValue: function(value, locale) { return i18n("%1 ms", value)} - - value: kcm.osdDuration - - onValueChanged: kcm.osdDuration = value - } - } - - RowLayout { - Layout.fillWidth: true - - Item { - width: units.largeSpacing - } - - QtControls.CheckBox { - id: osdTextOnly - - enabled: osdEnabled.checked - - text: i18n("Show desktop layout indicators") - - checked: !kcm.osdTextOnly - - onToggled: kcm.osdTextOnly = !checked - } + onToggled: kcm.osdTextOnly = !checked } } }