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.onSpacePressed: selected()
|
||||||
Keys.onEnterPressed: selected()
|
Keys.onEnterPressed: selected()
|
||||||
|
|
||||||
onPressAndHold: root.contextMenuRequested()
|
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
|
||||||
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
||||||
onTapped: (eventPoint, button) => {
|
onTapped: (eventPoint, button) => {
|
||||||
if (button === Qt.RightButton) {
|
if (button === Qt.RightButton) {
|
||||||
@@ -47,6 +46,11 @@ Delegates.RoundedItemDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
|
onLongPressed: root.contextMenuRequested()
|
||||||
|
}
|
||||||
|
|
||||||
contentItem: AvatarNotification {
|
contentItem: AvatarNotification {
|
||||||
id: avatarNotification
|
id: avatarNotification
|
||||||
source: root.source
|
source: root.source
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ Delegates.RoundedItemDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressAndHold: createRoomListContextMenu()
|
|
||||||
|
|
||||||
Keys.onSpacePressed: clicked()
|
Keys.onSpacePressed: clicked()
|
||||||
Keys.onEnterPressed: clicked()
|
Keys.onEnterPressed: clicked()
|
||||||
Keys.onReturnPressed: clicked()
|
Keys.onReturnPressed: clicked()
|
||||||
@@ -54,6 +52,11 @@ Delegates.RoundedItemDelegate {
|
|||||||
onTapped: (eventPoint, button) => root.createRoomListContextMenu()
|
onTapped: (eventPoint, button) => root.createRoomListContextMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
|
onLongPressed: root.createRoomListContextMenu()
|
||||||
|
}
|
||||||
|
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
spacing: Kirigami.Units.largeSpacing
|
spacing: Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,12 @@ QQC2.Control {
|
|||||||
TapHandler {
|
TapHandler {
|
||||||
enabled: root.time.toString() !== "Invalid Date"
|
enabled: root.time.toString() !== "Invalid Date"
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
|
||||||
onTapped: RoomManager.maximizeCode(root.author, root.time, root.display, root.componentAttributes.class)
|
onTapped: RoomManager.maximizeCode(root.author, root.time, root.display, root.componentAttributes.class)
|
||||||
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
onLongPressed: root.showMessageMenu()
|
onLongPressed: root.showMessageMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,11 +68,13 @@ TimelineDelegate {
|
|||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
|
||||||
onTapped: _private.showMessageMenu()
|
onTapped: _private.showMessageMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
onLongPressed: _private.showMessageMenu()
|
onLongPressed: _private.showMessageMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ ColumnLayout {
|
|||||||
});
|
});
|
||||||
map.open();
|
map.open();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
onLongPressed: openMessageContext("")
|
onLongPressed: openMessageContext("")
|
||||||
}
|
}
|
||||||
TapHandler {
|
TapHandler {
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ ColumnLayout {
|
|||||||
});
|
});
|
||||||
map.open();
|
map.open();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
onLongPressed: openMessageContext("")
|
onLongPressed: openMessageContext("")
|
||||||
}
|
}
|
||||||
TapHandler {
|
TapHandler {
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ TimelineDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onLongPressed: _private.showMessageMenu()
|
onLongPressed: _private.showMessageMenu()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ QQC2.Control {
|
|||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
enabled: !quoteText.hoveredLink
|
enabled: !quoteText.hoveredLink
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onLongPressed: root.showMessageMenu()
|
onLongPressed: root.showMessageMenu()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ a{
|
|||||||
TapHandler {
|
TapHandler {
|
||||||
enabled: !root.hoveredLink
|
enabled: !root.hoveredLink
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
|
acceptedDevices: PointerDevice.TouchScreen
|
||||||
onLongPressed: root.showMessageMenu()
|
onLongPressed: root.showMessageMenu()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user