Fix triple click not selecting last message char

This commit is contained in:
miruka 2019-09-11 01:55:07 -04:00
parent 72bcb9bbe3
commit 51e544ddf1
2 changed files with 4 additions and 5 deletions

View File

@ -13,6 +13,7 @@
- When qml syntax highlighting supports ES6 string interpolation, use that - When qml syntax highlighting supports ES6 string interpolation, use that
- Fixes - Fixes
- Quote links color in room subtitles
- Pressing backspace in composer sometimes doesn't work - Pressing backspace in composer sometimes doesn't work
- Message order isn't preserved when sending a first message in a E2E - Message order isn't preserved when sending a first message in a E2E
room, then while keys are being shared sending one with another account, room, then while keys are being shared sending one with another account,

View File

@ -9,7 +9,6 @@ Row {
readonly property string eventText: Utils.processedEventText(model) readonly property string eventText: Utils.processedEventText(model)
readonly property string eventTime: Utils.formatTime(model.date, false) readonly property string eventTime: Utils.formatTime(model.date, false)
readonly property int eventTimeSpaces: 2
readonly property string hoveredLink: readonly property string hoveredLink:
nameLabel.hoveredLink || contentLabel.hoveredLink nameLabel.hoveredLink || contentLabel.hoveredLink
@ -113,10 +112,9 @@ Row {
text: theme.chat.message.styleInclude + text: theme.chat.message.styleInclude +
eventContent.eventText + eventContent.eventText +
// time // time
" ".repeat(eventTimeSpaces) + " " +
"<font size=" + theme.fontSize.small + "<font size=" + theme.fontSize.small +
"px color=" + theme.chat.message.date + "px color=" + theme.chat.message.date + '>' +
' style="vertical-align: middle">' +
eventTime + eventTime +
"</font>" + "</font>" +
// local echo icon // local echo icon
@ -134,7 +132,7 @@ Row {
contentLabel.select( contentLabel.select(
0, 0,
contentLabel.length - contentLabel.length -
eventTime.length - eventTimeSpaces, eventTime.length - 1 // - 1: separating space
) )
contentLabel.updateContainerSelectedTexts() contentLabel.updateContainerSelectedTexts()
} }