Move message styles to their own files and work around hover not propagating to siblings
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 {
|