From 351f613ef405193ab6e00e81b2d87f1e4c12458f Mon Sep 17 00:00:00 2001 From: Jakob Petsovits Date: Sun, 14 Apr 2024 14:29:10 -0400 Subject: [PATCH] kcms/desktop: Expand button label from "Add" to "Add Desktop" Also pull "Rows" out of the SpinBox into a dedicated label. Both to address concerns "Add" about being misinterpreted as "Add Row", given that the button to add a new virtual desktop now sits right next to the row count spinner. --- src/kcms/desktop/ui/main.qml | 45 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/kcms/desktop/ui/main.qml b/src/kcms/desktop/ui/main.qml index 12c27efc3e..af3a73fabc 100644 --- a/src/kcms/desktop/ui/main.qml +++ b/src/kcms/desktop/ui/main.qml @@ -19,36 +19,39 @@ KCM.ScrollViewKCM { actions: [ Kirigami.Action { - displayComponent: QQC2.SpinBox { - id: rowsSpinBox + displayComponent: RowLayout { + spacing: Kirigami.Units.smallSpacing - from: 1 - to: 20 - editable: true - value: kcm.desktopsModel.rows - - textFromValue: (value, locale) => i18np("1 Row", "%1 Rows", value) - valueFromText: (text, locale) => parseInt(text, 10) - - onValueModified: kcm.desktopsModel.rows = value - - KCM.SettingHighlighter { - highlight: kcm.desktopsModel.rows !== 2 + QQC2.Label { + text: i18nc("@text:label Number of rows, label associated to a number input field", "Rows:") } - Connections { - target: kcm.desktopsModel + QQC2.SpinBox { + id: rowsSpinBox - function onReadyChanged() { - rowsSpinBox.value = kcm.desktopsModel.rows; + from: 1 + to: 20 + editable: true + value: kcm.desktopsModel.rows + onValueModified: kcm.desktopsModel.rows = value + + KCM.SettingHighlighter { + highlight: kcm.desktopsModel.rows !== 2 } - function onRowsChanged() { - rowsSpinBox.value = kcm.desktopsModel.rows; + Connections { + target: kcm.desktopsModel + + function onReadyChanged() { + rowsSpinBox.value = kcm.desktopsModel.rows; + } + function onRowsChanged() { + rowsSpinBox.value = kcm.desktopsModel.rows; + } } } } }, Kirigami.Action { - text: i18nc("@action:button", "Add") + text: i18nc("@action:button", "Add Desktop") icon.name: "list-add" onTriggered: kcm.desktopsModel.createDesktop() }