Implement shift+click/A-B message selection

This commit is contained in:
miruka
2020-03-26 23:24:37 -04:00
parent e696c16fc8
commit ba86414ddf
7 changed files with 80 additions and 5 deletions

View File

@@ -64,22 +64,35 @@ ListView {
}
}
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
property bool allowDragging: true
property alias cursorShape: mouseArea.cursorShape
property int currentItemHeight: currentItem ? currentItem.height : 0
property var checkedDelegates: ({})
property int lastCheckedDelegateIndex: 0
property int selectedCount: Object.keys(checkedDelegates).length
function delegatesChecked(...indices) {
print( indices)
for (const i of indices) {
const model = listView.model.get(i)
checkedDelegates[model.id] = model
}
lastCheckedDelegateIndex = indices.slice(-1)[0]
checkedDelegatesChanged()
}
function delegatesFromLastToHereChecked(here) {
const indices = utils.range(lastCheckedDelegateIndex, here)
eventList.delegatesChecked(...indices)
}
function delegatesUnchecked(...indices) {
for (const i of indices) {
const model = listView.model.get(i)