summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-02-14 23:13:17 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-02-14 23:13:22 +0100
commitd330fdb61fa96d86f3346fbf68e448494555d321 (patch)
treeefa3481feeafde30fe1019e4c56cd00198b026be
parentAllow window sizes smaller than 400x400 (diff)
downloadnheko-d330fdb61fa96d86f3346fbf68e448494555d321.tar.xz
Fix hovering messages
-rw-r--r--resources/qml/MessageView.qml25
-rw-r--r--resources/qml/TimelineRow.qml10
2 files changed, 12 insertions, 23 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index b65b9692..e6186e9d 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -360,7 +360,7 @@ ScrollView {
 
         }
 
-        delegate: Item {
+        delegate: ItemDelegate {
             id: wrapper
 
             required property double proportionalHeight
@@ -404,12 +404,11 @@ ScrollView {
             width: chat.delegateMaxWidth
             height: section.active ? section.height + timelinerow.height : timelinerow.height
 
-            Rectangle {
+            background: Rectangle {
                 id: scrollHighlight
 
                 opacity: 0
                 visible: true
-                anchors.fill: timelinerow
                 color: Nheko.colors.highlight
 
                 states: State {
@@ -474,7 +473,7 @@ ScrollView {
             TimelineRow {
                 id: timelinerow
 
-                property alias hovered: hoverHandler.hovered
+                hovered: wrapper.hovered
 
                 proportionalHeight: wrapper.proportionalHeight
                 type: chat.model, wrapper.type
@@ -507,21 +506,15 @@ ScrollView {
                 status: wrapper.status
                 relatedEventCacheBuster: wrapper.relatedEventCacheBuster
                 y: section.visible && section.active ? section.y + section.height : 0
+            }
 
-                HoverHandler {
-                    id: hoverHandler
-
-                    enabled: !Settings.mobileMode
-                    onHoveredChanged: {
-                        if (hovered) {
-                            if (!messageActionHover.hovered) {
-                                messageActions.attached = timelinerow;
-                                messageActions.model = timelinerow;
-                            }
-                        }
+            onHoveredChanged: {
+                if (!Settings.mobileMode && hovered) {
+                    if (!messageActionHover.hovered) {
+                        messageActions.attached = timelinerow;
+                        messageActions.model = timelinerow;
                     }
                 }
-
             }
 
             Connections {
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index b74fb5c1..37a20e9c 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -45,20 +45,16 @@ Item {
     required property int status
     required property int relatedEventCacheBuster
 
+    property bool hovered: false
+
     width: parent.width
     height: childrenRect.height
 
     Rectangle {
-        color: (Settings.messageHoverHighlight && hoverHandler.hovered) ? Nheko.colors.alternateBase : "transparent"
+        color: (Settings.messageHoverHighlight && hovered) ? Nheko.colors.alternateBase : "transparent"
         anchors.fill: row
     }
 
-    HoverHandler {
-        id: hoverHandler
-
-        acceptedDevices: PointerDevice.GenericPointer
-    }
-
     TapHandler {
         acceptedButtons: Qt.RightButton
         onSingleTapped: messageContextMenu.show(eventId, type, isSender, isEncrypted, isEditable, contentItem.child.hoveredLink, contentItem.child.copyText)