summary refs log tree commit diff
path: root/resources/qml/delegates
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-09-20 02:17:20 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-09-20 02:17:20 +0200
commit184806bf71faa9f4bcb1745a654dcb8dccc2e864 (patch)
treee115e9c7bd5ad83fdafa2ae50a7a4be0b51d06a9 /resources/qml/delegates
parentFix alignment of file messages and redactions (diff)
downloadnheko-184806bf71faa9f4bcb1745a654dcb8dccc2e864.tar.xz
Move message styles to their own files and work around hover not propagating to siblings
Diffstat (limited to 'resources/qml/delegates')
-rw-r--r--resources/qml/delegates/ImageMessage.qml13
-rw-r--r--resources/qml/delegates/TextMessage.qml3
2 files changed, 10 insertions, 6 deletions
diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml
index 466041bd..0369d5a1 100644
--- a/resources/qml/delegates/ImageMessage.qml
+++ b/resources/qml/delegates/ImageMessage.qml
@@ -130,21 +130,23 @@ AbstractButton {
         id: mxcimage
 
         visible: loaded
-        anchors.fill: parent
         roomm: room
         play: !Settings.animateImagesOnHover || parent.hovered
         eventId: parent.eventId
+        width: parent.implicitWidth
+        height: parent.implicitHeight
     }
 
     Image {
         id: blurhash_
 
-        anchors.fill: parent
         source: blurhash ? ("image://blurhash/" + blurhash) : ("image://colorimage/:/icons/icons/ui/image-failed.svg?" + palette.buttonText)
         asynchronous: true
         fillMode: Image.PreserveAspectFit
-        sourceSize.width: parent.width * Screen.devicePixelRatio
-        sourceSize.height: parent.height * Screen.devicePixelRatio
+        sourceSize.width: parent.implicitWidth * Screen.devicePixelRatio
+        sourceSize.height: parent.implicitHeight * Screen.devicePixelRatio
+        width: parent.implicitWidth
+        height: parent.implicitHeight
     }
 
     onClicked: Settings.openImageExternal ? room.openMedia(eventId) : TimelineManager.openImageOverlay(room, url, eventId, originalWidth, proportionalHeight);
@@ -152,7 +154,8 @@ AbstractButton {
     Item {
         id: overlay
 
-        anchors.fill: parent
+        width: parent.implicitWidth
+        height: parent.implicitHeight
         visible: parent.hovered
 
         Rectangle {
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index dc8caf01..9ef2e6cc 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -44,7 +44,8 @@ MatrixText {
     Layout.maximumHeight: !keepFullText ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : implicitHeight
     clip: !keepFullText
     selectByMouse: !Settings.mobileMode && !isReply
-    enabled: !Settings.mobileMode
+    enabled: !Settings.mobileMode && !isReply
+    hoverEnabled: !Settings.mobileMode
     font.pointSize: (Settings.enlargeEmojiOnlyMessages && isOnlyEmoji > 0 && isOnlyEmoji < 4) ? Settings.fontSize * 3 : Settings.fontSize
 
     NhekoCursorShape {