multi select and removal. Slides aren't perfect yet.

This commit is contained in:
Chris Cochrun 2023-01-24 15:29:56 -06:00
parent 4bf1790708
commit 7a8c7cc389
7 changed files with 77 additions and 3 deletions

View file

@ -90,6 +90,8 @@ Item {
implicitWidth: serviceItemList.width
height: Kirigami.Units.gridUnit * 2
property var selectedItems
DropArea {
id: serviceDrop
anchors.fill: parent
@ -238,8 +240,13 @@ Item {
}
onClicked: {
if (mouse.button === Qt.RightButton)
if (mouse.button === Qt.RightButton) {
if (!selected) {
serviceItemList.currentIndex = index;
ServiceItemModel.select(index);
}
rightClickMenu.popup(mouse);
}
else if ((mouse.button === Qt.LeftButton) && (mouse.modifiers === Qt.ShiftModifier)) {
selectItems(index);
} else {
@ -276,9 +283,15 @@ Item {
id: rightClickMenu
x: mouse.mouseX
y: mouse.mouseY + 10
Kirigami.Action {
text: "copy"
}
Kirigami.Action {
text: "paste"
}
Kirigami.Action {
text: "delete"
onTriggered: removeItem(index);
onTriggered: removeItems()
}
}
}
@ -513,6 +526,10 @@ Item {
/* totalServiceItems--; */
}
function removeItems() {
ServiceItemModel.removeItems();
}
function addItem(index, name, type,
background, backgroundType, text, audio,
font, fontSize, itemID) {