multi select and removal. Slides aren't perfect yet.
This commit is contained in:
parent
4bf1790708
commit
7a8c7cc389
7 changed files with 77 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue