summary refs log tree commit diff
path: root/resources/qml/RoomList.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-31 11:04:47 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-31 11:08:52 +0200
commit5b0bd26795abdf222d0cfd3e5ee3cf8e8b41a9c9 (patch)
tree9a1150352a407d5038904d5e10bbd8e3629eb6d0 /resources/qml/RoomList.qml
parentMerge pull request #655 from LorenDB/qml-all-the-things (diff)
downloadnheko-5b0bd26795abdf222d0cfd3e5ee3cf8e8b41a9c9.tar.xz
Fix annoying touch overlap in room list
Diffstat (limited to 'resources/qml/RoomList.qml')
-rw-r--r--resources/qml/RoomList.qml43
1 files changed, 25 insertions, 18 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index a2e50fab..695b08f3 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -172,31 +172,38 @@ Page {
                 }
             ]
 
-            TapHandler {
-                margin: -Nheko.paddingSmall
-                acceptedButtons: Qt.RightButton
-                onSingleTapped: {
-                    if (!TimelineManager.isInvite)
-                        roomContextMenu.show(roomId, tags);
+            // NOTE(Nico): We want to prevent the touch areas from overlapping. For some reason we need to add 1px of padding for that...
+            Item {
+                anchors.fill: parent
+                anchors.margins: 1
 
+                TapHandler {
+                    acceptedButtons: Qt.RightButton
+                    onSingleTapped: {
+                        if (!TimelineManager.isInvite)
+                            roomContextMenu.show(roomId, tags);
+
+                    }
+                    gesturePolicy: TapHandler.ReleaseWithinBounds
+                    acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | DeviceType.TouchPad
                 }
-                gesturePolicy: TapHandler.ReleaseWithinBounds
-            }
 
-            TapHandler {
-                margin: -Nheko.paddingSmall
-                onSingleTapped: Rooms.setCurrentRoom(roomId)
-                onLongPressed: {
-                    if (!isInvite)
-                        roomContextMenu.show(roomId, tags);
+                TapHandler {
+                    margin: -Nheko.paddingSmall
+                    onSingleTapped: Rooms.setCurrentRoom(roomId)
+                    onLongPressed: {
+                        if (!isInvite)
+                            roomContextMenu.show(roomId, tags);
 
+                    }
                 }
-            }
 
-            HoverHandler {
-                id: hovered
+                HoverHandler {
+                    id: hovered
+
+                    acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | DeviceType.TouchPad
+                }
 
-                margin: -Nheko.paddingSmall
             }
 
             RowLayout {