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
This commit is contained in:
miruka 2020-09-29 01:37:50 -04:00
parent ee1091b4dc
commit e6499d8fba
2 changed files with 11 additions and 7 deletions

View File

@ -37,16 +37,16 @@ HRowLayout {
readonly property string timeText: utils.formatTime(model.date, false) readonly property string timeText: utils.formatTime(model.date, false)
readonly property string stateText: readonly property string stateText:
`<font size=${theme.fontSize.small}px color=` + ( `<font size=${theme.fontSize.small}px><font ` + (
model.is_local_echo ? model.is_local_echo ?
`${theme.chat.message.localEcho}>&nbsp;</font>` : // U+29D7 `color="${theme.chat.message.localEcho}">&nbsp;` : // U+29D7
model.read_by_count ? model.read_by_count ?
`${theme.chat.message.readCounter}>&nbsp;⦿&nbsp;` + `color="${theme.chat.message.readCounter}">&nbsp;⦿&nbsp;` +
model.read_by_count : // U+29BF model.read_by_count : // U+29BF
"" ">"
) + "</font>" ) + "</font></font>"
readonly property bool pureMedia: ! contentText && linksRepeater.count readonly property bool pureMedia: ! contentText && linksRepeater.count
@ -318,7 +318,10 @@ HRowLayout {
mediaUrl: modelData mediaUrl: modelData
showSender: pureMedia ? senderText : "" showSender: pureMedia ? senderText : ""
showDate: pureMedia ? timeText : "" showDate: pureMedia ? timeText : ""
showLocalEcho: pureMedia ? stateText : "" showLocalEcho: pureMedia && (
singleMediaInfo.is_local_echo ||
singleMediaInfo.read_by_count
) ? stateText : ""
transform: Translate { x: xOffset } transform: Translate { x: xOffset }

View File

@ -133,7 +133,8 @@ HMxcImage {
EventImageTextBubble { EventImageTextBubble {
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: [loader.showDate, loader.showLocalEcho].join(" ").trim() text: loader.showDate + loader.showLocalEcho
textFormat: Text.StyledText textFormat: Text.StyledText
opacity: hover.hovered ? 0 : 1 opacity: hover.hovered ? 0 : 1
visible: opacity > 0 visible: opacity > 0