mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fix binding loop and non integer text height
This commit is contained in:
parent
4e7bd20e0c
commit
fdcf91f5eb
3 changed files with 7 additions and 4 deletions
|
@ -8,6 +8,9 @@ TextEdit {
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: colors.text
|
color: colors.text
|
||||||
|
|
||||||
|
font.hintingPreference: Font.PreferFullHinting
|
||||||
|
renderType: Text.NativeRendering
|
||||||
|
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1])
|
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])
|
else if (/^https:\/\/matrix.to\/#\/(![^\/]*)$/.test(link)) timelineManager.setHistoryView(/^https:\/\/matrix.to\/#\/(!.*)$/.exec(link)[1])
|
||||||
|
|
|
@ -11,6 +11,8 @@ import "./delegates"
|
||||||
import "./emoji"
|
import "./emoji"
|
||||||
|
|
||||||
Page {
|
Page {
|
||||||
|
id: timelineRoot
|
||||||
|
|
||||||
property var colors: currentActivePalette
|
property var colors: currentActivePalette
|
||||||
property var systemInactive: SystemPalette { colorGroup: SystemPalette.Disabled }
|
property var systemInactive: SystemPalette { colorGroup: SystemPalette.Disabled }
|
||||||
property var inactiveColors: currentInactivePalette ? currentInactivePalette : systemInactive
|
property var inactiveColors: currentInactivePalette ? currentInactivePalette : systemInactive
|
||||||
|
@ -88,8 +90,6 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id: timelineRoot
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: colors.window
|
color: colors.window
|
||||||
|
@ -114,7 +114,7 @@ Page {
|
||||||
ListView {
|
ListView {
|
||||||
id: chat
|
id: chat
|
||||||
|
|
||||||
visible: timelineManager.timeline != null
|
visible: !!timelineManager.timeline
|
||||||
|
|
||||||
cacheBuffer: 400
|
cacheBuffer: 400
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ MatrixText {
|
||||||
property string formatted: model.data.formattedBody
|
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'>")
|
text: "<style type=\"text/css\">a { color:"+colors.link+";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap'>")
|
||||||
width: parent ? parent.width : undefined
|
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
|
clip: true
|
||||||
font.pointSize: (settings.enlargeEmojiOnlyMessages && model.data.isOnlyEmoji > 0 && model.data.isOnlyEmoji < 4) ? settings.fontSize * 3 : settings.fontSize
|
font.pointSize: (settings.enlargeEmojiOnlyMessages && model.data.isOnlyEmoji > 0 && model.data.isOnlyEmoji < 4) ? settings.fontSize * 3 : settings.fontSize
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue