From 324480570b97441e6df9cc048ac35393236ce8bb Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Tue, 25 May 2021 13:14:04 -0600 Subject: [PATCH] [kcmkwin/kwindesktop] Allow renaming desktops with double-click Similar to the feature to allow inline renaming in file managers, you can now trigger renaming for a desktop by double-clicking on its list item. BUG: 421882 FIXED-IN: 5.23 --- .../kwindesktop/package/contents/ui/main.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/kcmkwin/kwindesktop/package/contents/ui/main.qml b/src/kcmkwin/kwindesktop/package/contents/ui/main.qml index d6ab898718..722395c9ae 100644 --- a/src/kcmkwin/kwindesktop/package/contents/ui/main.qml +++ b/src/kcmkwin/kwindesktop/package/contents/ui/main.qml @@ -46,10 +46,10 @@ KCM.ScrollViewKCM { bottomPadding: 0 Layout.fillWidth: true - - Layout.alignment: Qt.AlignVCenter + Layout.fillHeight: true text: model ? model.display : "" + verticalAlignment: Text.AlignVCenter readOnly: true @@ -60,6 +60,14 @@ KCM.ScrollViewKCM { onEditingFinished: { readOnly = true; } + + MouseArea { + anchors.fill: parent + + onDoubleClicked: { + renameAction.trigger(); + } + } } Rectangle { @@ -75,6 +83,7 @@ KCM.ScrollViewKCM { actions: [ Kirigami.Action { + id: renameAction enabled: model && !model.IsMissing iconName: "edit-rename" tooltip: i18nc("@info:tooltip", "Rename")