updating old leftdock

This commit is contained in:
Chris Cochrun 2022-09-19 14:50:38 -05:00
parent 23b7210169
commit c10e42cc2c

View file

@ -287,6 +287,7 @@ ColumnLayout {
print("moveRequested: ", oldIndex, newIndex); print("moveRequested: ", oldIndex, newIndex);
visualModel.items.move(oldIndex, newIndex); visualModel.items.move(oldIndex, newIndex);
indexDragged = newIndex; indexDragged = newIndex;
serviceItemList.currentIndex = indexDragged;
} }
} }
@ -337,17 +338,32 @@ ColumnLayout {
Kirigami.Action { Kirigami.Action {
/* text: "Up" */ /* text: "Up" */
icon.name: "arrow-up" icon.name: "arrow-up"
onTriggered: showPassiveNotification("Up") onTriggered: {
const oldid = serviceItemList.currentIndex;
const newid = serviceItemList.currentIndex - 1;
showPassiveNotification("Up");
serviceItemList.moveRequested(oldid, newid);
serviceItemList.currentIndex = newid;
}
}, },
Kirigami.Action { Kirigami.Action {
/* text: "Down" */ /* text: "Down" */
icon.name: "arrow-down" icon.name: "arrow-down"
onTriggered: showPassiveNotification("down") onTriggered: {
const oldid = serviceItemList.currentIndex;
const newid = serviceItemList.currentIndex + 1;
showPassiveNotification("Down");
serviceItemList.moveRequested(oldid, newid);
serviceItemList.currentIndex = newid;
}
}, },
Kirigami.Action { Kirigami.Action {
/* text: "Remove" */ /* text: "Remove" */
icon.name: "delete" icon.name: "delete"
onTriggered: showPassiveNotification("remove") onTriggered: {
showPassiveNotification("remove");
removeItem(serviceItemList.currentIndex);
}
} }
] ]
} }