[kcms/virtualdesktop] Don't offer to remove the last desktop

The current UI allows to remove the last desktop, but:
- If you remove it it will reappear on the next KCM launch
- The Add button does not work then

Prevent removing the last desktop by disabling the action

BUG: 437561
This commit is contained in:
Nicolas Fella 2021-05-23 21:21:55 +02:00
parent 7f36f01247
commit b31ef46576

View file

@ -85,7 +85,7 @@ KCM.ScrollViewKCM {
}
},
Kirigami.Action {
enabled: model && !model.IsMissing
enabled: model && !model.IsMissing && desktopsList.count !== 1
iconName: "edit-delete-remove"
tooltip: i18nc("@info:tooltip", "Remove")
onTriggered: kcm.desktopsModel.removeDesktop(model.Id)