[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.
This commit is contained in:
Nate Graham 2021-05-25 13:33:05 -06:00
parent 324480570b
commit 20b8d606e1

View file

@ -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"