Fix binding loop and non integer text height

pull/251/head
Nicolas Werner 4 years ago
parent 4e7bd20e0c
commit fdcf91f5eb
  1. 3
      resources/qml/MatrixText.qml
  2. 6
      resources/qml/TimelineView.qml
  3. 2
      resources/qml/delegates/TextMessage.qml

@ -8,6 +8,9 @@ TextEdit {
selectByMouse: true
color: colors.text
font.hintingPreference: Font.PreferFullHinting
renderType: Text.NativeRendering
onLinkActivated: {
if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1])
else if (/^https:\/\/matrix.to\/#\/(![^\/]*)$/.test(link)) timelineManager.setHistoryView(/^https:\/\/matrix.to\/#\/(!.*)$/.exec(link)[1])

@ -11,6 +11,8 @@ import "./delegates"
import "./emoji"
Page {
id: timelineRoot
property var colors: currentActivePalette
property var systemInactive: SystemPalette { colorGroup: SystemPalette.Disabled }
property var inactiveColors: currentInactivePalette ? currentInactivePalette : systemInactive
@ -88,8 +90,6 @@ Page {
}
}
id: timelineRoot
Rectangle {
anchors.fill: parent
color: colors.window
@ -114,7 +114,7 @@ Page {
ListView {
id: chat
visible: timelineManager.timeline != null
visible: !!timelineManager.timeline
cacheBuffer: 400

@ -4,7 +4,7 @@ MatrixText {
property string formatted: model.data.formattedBody
text: "<style type=\"text/css\">a { color:"+colors.link+";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap'>")
width: parent ? parent.width : undefined
height: isReply ? Math.min(chat.height / 8, implicitHeight) : undefined
height: isReply ? Math.round(Math.min(timelineRoot.height / 8, implicitHeight)) : undefined
clip: true
font.pointSize: (settings.enlargeEmojiOnlyMessages && model.data.isOnlyEmoji > 0 && model.data.isOnlyEmoji < 4) ? settings.fontSize * 3 : settings.fontSize
}

Loading…
Cancel
Save