From e6499d8fba0d8f6a8ac0bd070025934fc25b02c7 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 29 Sep 2020 01:37:50 -0400 Subject: [PATCH] Fix read counter display on EventImage - Fix extra spacing on the right of the date when there's no read counter to show - Fix read counter not being colored --- src/gui/Pages/Chat/Timeline/EventContent.qml | 15 +++++++++------ src/gui/Pages/Chat/Timeline/EventImage.qml | 3 ++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/Pages/Chat/Timeline/EventContent.qml b/src/gui/Pages/Chat/Timeline/EventContent.qml index 2ab837f4..8512dfb4 100644 --- a/src/gui/Pages/Chat/Timeline/EventContent.qml +++ b/src/gui/Pages/Chat/Timeline/EventContent.qml @@ -37,16 +37,16 @@ HRowLayout { readonly property string timeText: utils.formatTime(model.date, false) readonly property string stateText: - ` ⧗` : // U+29D7 + `color="${theme.chat.message.localEcho}"> ⧗` : // U+29D7 model.read_by_count ? - `${theme.chat.message.readCounter}> ⦿ ` + + `color="${theme.chat.message.readCounter}"> ⦿ ` + model.read_by_count : // U+29BF - "" - ) + "" + ">" + ) + "" readonly property bool pureMedia: ! contentText && linksRepeater.count @@ -318,7 +318,10 @@ HRowLayout { mediaUrl: modelData showSender: pureMedia ? senderText : "" showDate: pureMedia ? timeText : "" - showLocalEcho: pureMedia ? stateText : "" + showLocalEcho: pureMedia && ( + singleMediaInfo.is_local_echo || + singleMediaInfo.read_by_count + ) ? stateText : "" transform: Translate { x: xOffset } diff --git a/src/gui/Pages/Chat/Timeline/EventImage.qml b/src/gui/Pages/Chat/Timeline/EventImage.qml index cbaf9b39..883dd464 100644 --- a/src/gui/Pages/Chat/Timeline/EventImage.qml +++ b/src/gui/Pages/Chat/Timeline/EventImage.qml @@ -133,7 +133,8 @@ HMxcImage { EventImageTextBubble { anchors.right: parent.right anchors.bottom: parent.bottom - text: [loader.showDate, loader.showLocalEcho].join(" ").trim() + text: loader.showDate + loader.showLocalEcho + textFormat: Text.StyledText opacity: hover.hovered ? 0 : 1 visible: opacity > 0