From 184806bf71faa9f4bcb1745a654dcb8dccc2e864 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 20 Sep 2023 02:17:20 +0200 Subject: Move message styles to their own files and work around hover not propagating to siblings --- resources/qml/delegates/ImageMessage.qml | 13 ++++++++----- resources/qml/delegates/TextMessage.qml | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'resources/qml/delegates') 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 { -- cgit 1.5.1