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

@@ -57,8 +57,6 @@ HColumnLayout {
combine ? theme.spacing / (compact ? 4 : 2) :
theme.spacing * (compact ? 1 : 2)
readonly property alias leftTapHandler: leftTapHandler
// Needed because of eventList's MouseArea which steals the
// HSelectableLabel's MouseArea hover events
onCursorShapeChanged: eventList.cursorShape = cursorShape
@@ -114,11 +112,17 @@ HColumnLayout {
}
TapHandler {
id: leftTapHandler
acceptedButtons: Qt.LeftButton
acceptedModifiers: Qt.NoModifier
onTapped: toggleChecked()
}
TapHandler {
acceptedButtons: Qt.LeftButton
acceptedModifiers: Qt.ShiftModifier
onTapped: eventList.delegatesFromLastToHereChecked(model.index)
}
TapHandler {
acceptedButtons: Qt.RightButton
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
@@ -151,6 +155,13 @@ HColumnLayout {
onTriggered: eventList.checkedDelegates = {}
}
HMenuItem {
visible: model.index !== 0
icon.name: "select-until-here"
text: qsTr("Select until here")
onTriggered: eventList.delegatesFromLastToHereChecked(model.index)
}
HMenuItem {
id: copyMedia
icon.name: "copy-link"