Fix most reply rendering issues with qt 6.9.2
This commit is contained in:
parent
53cd31d181
commit
2769642d3c
4 changed files with 65 additions and 70 deletions
|
|
@ -210,9 +210,10 @@ TimelineEvent {
|
||||||
|
|
||||||
AbstractButton {
|
AbstractButton {
|
||||||
id: replyRow
|
id: replyRow
|
||||||
visible: wrapper.reply
|
visible: wrapper.replyTo
|
||||||
|
|
||||||
|
leftPadding: Nheko.paddingSmall + 4
|
||||||
|
|
||||||
height: replyLine.height
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
|
@ -225,19 +226,7 @@ TimelineEvent {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: Row {
|
contentItem: Column {
|
||||||
id: replyRowLay
|
|
||||||
|
|
||||||
spacing: Nheko.paddingSmall
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: replyLine
|
|
||||||
height: Math.min( wrapper.reply?.height, timelineView.height / 10) + Nheko.paddingSmall + replyUserButton.height
|
|
||||||
color: replyRow.userColor
|
|
||||||
width: 4
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
id: replyCol
|
id: replyCol
|
||||||
|
|
@ -247,7 +236,7 @@ TimelineEvent {
|
||||||
|
|
||||||
contentItem: Label {
|
contentItem: Label {
|
||||||
id: userName_
|
id: userName_
|
||||||
text: wrapper.reply?.userName ?? ''
|
text: wrapper.reply?.userName ?? 'missing name'
|
||||||
color: replyRow.userColor
|
color: replyRow.userColor
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
width: wrapper.maxWidth
|
width: wrapper.maxWidth
|
||||||
|
|
@ -260,11 +249,19 @@ TimelineEvent {
|
||||||
wrapper.reply,
|
wrapper.reply,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
//width: replyRow.implicitContentWidth
|
//width: replyRow.implicitContentWidth
|
||||||
color: Qt.tint(palette.base, Qt.hsla(replyRow.userColor.hslHue, 0.5, replyRow.userColor.hslLightness, 0.1))
|
color: Qt.tint(palette.base, Qt.hsla(replyRow.userColor.hslHue, 0.5, replyRow.userColor.hslLightness, 0.1))
|
||||||
|
Rectangle {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
|
||||||
|
id: replyLine
|
||||||
|
color: replyRow.userColor
|
||||||
|
width: 4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
||||||
|
|
@ -192,9 +192,9 @@ TimelineEvent {
|
||||||
|
|
||||||
AbstractButton {
|
AbstractButton {
|
||||||
id: replyRow
|
id: replyRow
|
||||||
visible: wrapper.reply
|
visible: wrapper.replyTo
|
||||||
|
|
||||||
height: replyLine.height
|
leftPadding: Nheko.paddingSmall + 4
|
||||||
|
|
||||||
property color userColor: TimelineManager.userColor(wrapper.reply?.userId ?? '', palette.base)
|
property color userColor: TimelineManager.userColor(wrapper.reply?.userId ?? '', palette.base)
|
||||||
|
|
||||||
|
|
@ -205,19 +205,7 @@ TimelineEvent {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: Row {
|
contentItem: Column {
|
||||||
id: replyRowLay
|
|
||||||
|
|
||||||
spacing: Nheko.paddingSmall
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: replyLine
|
|
||||||
height: Math.min( wrapper.reply?.height, timelineView.height / 10) + Nheko.paddingSmall + replyUserButton.height
|
|
||||||
color: replyRow.userColor
|
|
||||||
width: 4
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
id: replyCol
|
id: replyCol
|
||||||
|
|
@ -227,7 +215,7 @@ TimelineEvent {
|
||||||
|
|
||||||
contentItem: Label {
|
contentItem: Label {
|
||||||
id: userName_
|
id: userName_
|
||||||
text: wrapper.reply?.userName ?? ''
|
text: wrapper.reply?.userName ?? 'missing name'
|
||||||
color: replyRow.userColor
|
color: replyRow.userColor
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
width: wrapper.maxWidth
|
width: wrapper.maxWidth
|
||||||
|
|
@ -240,11 +228,19 @@ TimelineEvent {
|
||||||
wrapper.reply,
|
wrapper.reply,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
//width: replyRow.implicitContentWidth
|
|
||||||
color: Qt.tint(palette.base, Qt.hsla(replyRow.userColor.hslHue, 0.5, replyRow.userColor.hslLightness, 0.1))
|
color: Qt.tint(palette.base, Qt.hsla(replyRow.userColor.hslHue, 0.5, replyRow.userColor.hslLightness, 0.1))
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
|
||||||
|
id: replyLine
|
||||||
|
color: replyRow.userColor
|
||||||
|
width: 4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ Pane {
|
||||||
ImageButton {
|
ImageButton {
|
||||||
id: deletePinButton
|
id: deletePinButton
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
Layout.alignment: Qt.AlignTop | Qt.AlignRight
|
||||||
Layout.preferredHeight: 16
|
Layout.preferredHeight: 16
|
||||||
Layout.preferredWidth: 16
|
Layout.preferredWidth: 16
|
||||||
ToolTip.text: qsTr("Unpin")
|
ToolTip.text: qsTr("Unpin")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
import QtQuick.Layouts
|
||||||
import im.nheko
|
import im.nheko
|
||||||
import "../"
|
import "../"
|
||||||
|
|
||||||
|
|
@ -21,7 +22,11 @@ AbstractButton {
|
||||||
property string userId: eventId ? room.dataById(eventId, Room.UserId, "") : ""
|
property string userId: eventId ? room.dataById(eventId, Room.UserId, "") : ""
|
||||||
property string userName: eventId ? room.dataById(eventId, Room.UserName, "") : ""
|
property string userName: eventId ? room.dataById(eventId, Room.UserName, "") : ""
|
||||||
implicitHeight: replyContainer.height
|
implicitHeight: replyContainer.height
|
||||||
implicitWidth: replyContainer.implicitWidth
|
implicitWidth: replyContainer.implicitWidth + leftPadding + rightPadding
|
||||||
|
|
||||||
|
leftPadding: 4 + Nheko.paddingSmall
|
||||||
|
rightPadding: Nheko.paddingSmall
|
||||||
|
|
||||||
required property int maxWidth
|
required property int maxWidth
|
||||||
property bool limitHeight: false
|
property bool limitHeight: false
|
||||||
|
|
||||||
|
|
@ -31,14 +36,14 @@ AbstractButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
let link = reply.child.linkAt != undefined && reply.child.linkAt(pressX-colorline.width, pressY - userName_.implicitHeight);
|
let link = timelineEvent.main.linkAt != undefined && timelineEvent.main.linkAt(pressX-colorline.width, pressY - userName_.implicitHeight);
|
||||||
if (link) {
|
if (link) {
|
||||||
Nheko.openLink(link)
|
Nheko.openLink(link)
|
||||||
} else {
|
} else {
|
||||||
room.showEvent(r.eventId)
|
room.showEvent(r.eventId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onPressAndHold: replyContextMenu.show(reply.child.copyText, reply.child.linkAt(pressX-colorline.width, pressY - userName_.implicitHeight), r.eventId)
|
onPressAndHold: replyContextMenu.show(timelineEvent.main.copyText, timelineEvent.main.linkAt(pressX-colorline.width, pressY - userName_.implicitHeight), r.eventId)
|
||||||
|
|
||||||
contentItem: TimelineEvent {
|
contentItem: TimelineEvent {
|
||||||
id: timelineEvent
|
id: timelineEvent
|
||||||
|
|
@ -51,34 +56,22 @@ AbstractButton {
|
||||||
maxWidth: r.maxWidth
|
maxWidth: r.maxWidth
|
||||||
limitAsReply: r.limitHeight
|
limitAsReply: r.limitHeight
|
||||||
|
|
||||||
//height: replyContainer.implicitHeight
|
data: Column {
|
||||||
data: Row {
|
|
||||||
id: replyContainer
|
id: replyContainer
|
||||||
|
spacing: 0
|
||||||
spacing: Nheko.paddingSmall
|
|
||||||
|
|
||||||
clip: r.limitHeight
|
clip: r.limitHeight
|
||||||
|
|
||||||
height: r.limitHeight ? Math.min( timelineEvent.main?.height, timelineView.height / 10) + Nheko.paddingSmall + usernameBtn.height : undefined
|
height: r.limitHeight ? Math.min( timelineEvent.main?.height, timelineView.height / 10) + Nheko.paddingSmall + usernameBtn.height : undefined
|
||||||
|
|
||||||
Rectangle {
|
// FIXME: I have no idea, why this name doesn't render in the reply popup on Qt 6.9.2
|
||||||
id: colorline
|
|
||||||
|
|
||||||
width: 4
|
|
||||||
height: content.height
|
|
||||||
|
|
||||||
color: TimelineManager.userColor(r.userId, palette.base)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: content
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
AbstractButton {
|
AbstractButton {
|
||||||
id: usernameBtn
|
id: usernameBtn
|
||||||
|
|
||||||
|
visible: r.eventId
|
||||||
|
|
||||||
contentItem: Label {
|
contentItem: Label {
|
||||||
|
visible: r.eventId
|
||||||
id: userName_
|
id: userName_
|
||||||
text: r.userName
|
text: r.userName
|
||||||
color: r.userColor
|
color: r.userColor
|
||||||
|
|
@ -94,7 +87,6 @@ AbstractButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: backgroundItem
|
id: backgroundItem
|
||||||
|
|
@ -103,6 +95,16 @@ AbstractButton {
|
||||||
property color userColor: TimelineManager.userColor(r.userId, palette.base)
|
property color userColor: TimelineManager.userColor(r.userId, palette.base)
|
||||||
property color bgColor: palette.base
|
property color bgColor: palette.base
|
||||||
color: Qt.tint(bgColor, Qt.hsla(userColor.hslHue, 0.5, userColor.hslLightness, 0.1))
|
color: Qt.tint(bgColor, Qt.hsla(userColor.hslHue, 0.5, userColor.hslLightness, 0.1))
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
|
||||||
|
id: colorline
|
||||||
|
color: backgroundItem.userColor
|
||||||
|
width: 4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue