Fix some problems with overlapping chat bubbles and auto-scroll
* Fix the implicitHeight binding loop
* Revert the TypeError regression from 525d691c
* Fix resolving the showAuthor model role, drop the
isPooled/isReuser Loader hack for the autor name item
Fix #293
Fix #292
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
@@ -38,7 +38,7 @@ Item {
|
|||||||
|
|
||||||
property alias hovered: controlContainer.hovered
|
property alias hovered: controlContainer.hovered
|
||||||
|
|
||||||
implicitHeight: mainColumn.implicitHeight + (readMarker ? Kirigami.Units.smallSpacing : 0)
|
height: mainColumn.childrenRect.height + (readMarker ? Kirigami.Units.smallSpacing : 0)
|
||||||
|
|
||||||
property int hoverComponentX: column.width - hoverComponent.childWidth + Kirigami.Units.largeSpacing
|
property int hoverComponentX: column.width - hoverComponent.childWidth + Kirigami.Units.largeSpacing
|
||||||
property int hoverComponentY: -Kirigami.Units.largeSpacing - hoverComponent.childHeight * 1.5
|
property int hoverComponentY: -Kirigami.Units.largeSpacing - hoverComponent.childHeight * 1.5
|
||||||
@@ -111,7 +111,7 @@ Item {
|
|||||||
Layout.leftMargin: Kirigami.Units.largeSpacing
|
Layout.leftMargin: Kirigami.Units.largeSpacing
|
||||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.bottomMargin: 0
|
Layout.bottomMargin: 0
|
||||||
Layout.topMargin: showAuthor ? Kirigami.Units.smallSpacing : 0
|
Layout.topMargin: model.showAuthor ? Kirigami.Units.smallSpacing : 0
|
||||||
|
|
||||||
Kirigami.Avatar {
|
Kirigami.Avatar {
|
||||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 2
|
Layout.minimumWidth: Kirigami.Units.gridUnit * 2
|
||||||
@@ -121,7 +121,7 @@ Item {
|
|||||||
|
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
visible: showAuthor && Config.showAvatarInTimeline
|
visible: model.showAuthor && Config.showAvatarInTimeline
|
||||||
name: author.name ?? author.displayName
|
name: author.name ?? author.displayName
|
||||||
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
||||||
color: author.color
|
color: author.color
|
||||||
@@ -142,7 +142,7 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 2
|
Layout.minimumWidth: Kirigami.Units.gridUnit * 2
|
||||||
Layout.preferredHeight: 1
|
Layout.preferredHeight: 1
|
||||||
visible: !showAuthor && Config.showAvatarInTimeline
|
visible: !model.showAuthor && Config.showAvatarInTimeline
|
||||||
}
|
}
|
||||||
|
|
||||||
// bubble
|
// bubble
|
||||||
@@ -162,10 +162,9 @@ Item {
|
|||||||
Item { // top padding
|
Item { // top padding
|
||||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||||
}
|
}
|
||||||
// HACK: reload author when the delegate is reloaded, since there are strange issues with ListView reuseItems and the author displayName disappearing
|
|
||||||
Loader {
|
Loader {
|
||||||
id: topRow
|
id: topRow
|
||||||
active: isLoaded && showAuthor && !isEmote
|
active: model.showAuthor && !isEmote
|
||||||
visible: active
|
visible: active
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: Kirigami.Units.largeSpacing
|
Layout.leftMargin: Kirigami.Units.largeSpacing
|
||||||
@@ -174,14 +173,12 @@ Item {
|
|||||||
|
|
||||||
sourceComponent: RowLayout {
|
sourceComponent: RowLayout {
|
||||||
id: rowLayout
|
id: rowLayout
|
||||||
// maintain loader height
|
|
||||||
Component.onCompleted: topRow.implicitHeight = rowLayout.implicitHeight
|
|
||||||
|
|
||||||
QQC2.Label {
|
QQC2.Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
topInset: 0
|
topInset: 0
|
||||||
|
|
||||||
visible: showAuthor && !isEmote
|
visible: model.showAuthor && !isEmote
|
||||||
|
|
||||||
text: author.displayName
|
text: author.displayName
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
@@ -189,7 +186,7 @@ Item {
|
|||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
}
|
}
|
||||||
QQC2.Label {
|
QQC2.Label {
|
||||||
visible: showAuthor && !isEmote
|
visible: model.showAuthor && !isEmote
|
||||||
text: time.toLocaleTimeString(Locale.ShortFormat)
|
text: time.toLocaleTimeString(Locale.ShortFormat)
|
||||||
color: Kirigami.Theme.disabledTextColor
|
color: Kirigami.Theme.disabledTextColor
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user