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

@@ -183,6 +183,7 @@ HRowLayout {
PointHandler {
id: mousePointHandler
acceptedButtons: Qt.LeftButton
acceptedModifiers: Qt.NoModifier
acceptedPointerTypes:
PointerDevice.GenericPointer | PointerDevice.Eraser
@@ -206,6 +207,24 @@ HRowLayout {
property bool checkedNow: false
}
PointHandler {
id: mouseShiftPointHandler
acceptedButtons: Qt.LeftButton
acceptedModifiers: Qt.ShiftModifier
acceptedPointerTypes:
PointerDevice.GenericPointer | PointerDevice.Eraser
onActiveChanged: {
if (active &&
! eventDelegate.checked &&
(! parent.hoveredLink ||
! parent.enableLinkActivation)) {
eventList.delegatesFromLastToHereChecked(model.index)
}
}
}
TapHandler {
id: touchTapHandler
acceptedButtons: Qt.LeftButton
@@ -234,7 +253,8 @@ HRowLayout {
z: -100
color: eventDelegate.checked &&
! contentLabel.selectedText &&
! mousePointHandler.active ?
! mousePointHandler.active &&
! mouseShiftPointHandler.active ?
theme.chat.message.checkedBackground :
isOwn?