[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
This commit is contained in:
Nate Graham 2021-05-25 13:14:04 -06:00
parent 644dcbe173
commit 324480570b

View file

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