Don't allow long-pressing on non-touchscreen devices
It isn't the right kind of interaction on a computer with a mouse or trackpad, it should be relegated to touchscreen only. This should hopefully cover everything from room list delegates to messages.
This commit is contained in:
@@ -34,9 +34,8 @@ Delegates.RoundedItemDelegate {
|
||||
Keys.onSpacePressed: selected()
|
||||
Keys.onEnterPressed: selected()
|
||||
|
||||
onPressAndHold: root.contextMenuRequested()
|
||||
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
|
||||
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
||||
onTapped: (eventPoint, button) => {
|
||||
if (button === Qt.RightButton) {
|
||||
@@ -47,6 +46,11 @@ Delegates.RoundedItemDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: root.contextMenuRequested()
|
||||
}
|
||||
|
||||
contentItem: AvatarNotification {
|
||||
id: avatarNotification
|
||||
source: root.source
|
||||
|
||||
@@ -42,8 +42,6 @@ Delegates.RoundedItemDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
onPressAndHold: createRoomListContextMenu()
|
||||
|
||||
Keys.onSpacePressed: clicked()
|
||||
Keys.onEnterPressed: clicked()
|
||||
Keys.onReturnPressed: clicked()
|
||||
@@ -54,6 +52,11 @@ Delegates.RoundedItemDelegate {
|
||||
onTapped: (eventPoint, button) => root.createRoomListContextMenu()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: root.createRoomListContextMenu()
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
|
||||
@@ -128,7 +128,12 @@ QQC2.Control {
|
||||
TapHandler {
|
||||
enabled: root.time.toString() !== "Invalid Date"
|
||||
acceptedButtons: Qt.LeftButton
|
||||
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
|
||||
onTapped: RoomManager.maximizeCode(root.author, root.time, root.display, root.componentAttributes.class)
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: root.showMessageMenu()
|
||||
}
|
||||
|
||||
|
||||
@@ -68,11 +68,13 @@ TimelineDelegate {
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
|
||||
onTapped: _private.showMessageMenu()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: _private.showMessageMenu()
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ ColumnLayout {
|
||||
});
|
||||
map.open();
|
||||
}
|
||||
}
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: openMessageContext("")
|
||||
}
|
||||
TapHandler {
|
||||
|
||||
@@ -90,6 +90,9 @@ ColumnLayout {
|
||||
});
|
||||
map.open();
|
||||
}
|
||||
}
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: openMessageContext("")
|
||||
}
|
||||
TapHandler {
|
||||
|
||||
@@ -323,6 +323,7 @@ TimelineDelegate {
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onLongPressed: _private.showMessageMenu()
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ QQC2.Control {
|
||||
|
||||
TapHandler {
|
||||
enabled: !quoteText.hoveredLink
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onLongPressed: root.showMessageMenu()
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ a{
|
||||
TapHandler {
|
||||
enabled: !root.hoveredLink
|
||||
acceptedButtons: Qt.LeftButton
|
||||
acceptedDevices: PointerDevice.TouchScreen
|
||||
onLongPressed: root.showMessageMenu()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user