From 20b8d606e123ec48c55eb273a4bbeeaee1687507 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Tue, 25 May 2021 13:33:05 -0600 Subject: [PATCH] [kcmkwin/kwindesktop] Add explicit action to apply a rename The rnew name is applied when the user hits the return or enter key to finish renaming, but this is an invisible UI and the user might not think to do that. This commit replaces the "Rename" button with a "Confirm new name" button while the text field is editable, so that it's visibly clear how to finish renaming. --- src/kcmkwin/kwindesktop/package/contents/ui/main.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/kcmkwin/kwindesktop/package/contents/ui/main.qml b/src/kcmkwin/kwindesktop/package/contents/ui/main.qml index 722395c9ae..1d72a59c19 100644 --- a/src/kcmkwin/kwindesktop/package/contents/ui/main.qml +++ b/src/kcmkwin/kwindesktop/package/contents/ui/main.qml @@ -85,6 +85,7 @@ KCM.ScrollViewKCM { Kirigami.Action { id: renameAction enabled: model && !model.IsMissing + visible: !applyAction.visible iconName: "edit-rename" tooltip: i18nc("@info:tooltip", "Rename") onTriggered: { @@ -93,6 +94,15 @@ KCM.ScrollViewKCM { nameField.forceActiveFocus(); } }, + Kirigami.Action { + id: applyAction + visible: !nameField.readOnly + iconName: "dialog-ok-apply" + tooltip: i18nc("@info:tooltip", "Confirm new name") + onTriggered: { + nameField.readOnly = true; + } + }, Kirigami.Action { enabled: model && !model.IsMissing && desktopsList.count !== 1 iconName: "edit-delete"