Fix bubble header in right to left mode

Convert to rowLayout so that the bubble header works in right to left mode.

Before
![bubble_header_righttoleft_before](/uploads/91d9b5e41a7f84f8ab2750d1193ed4b6/bubble_header_righttoleft_before.png)

After
![bubble_header_righttoleft_after](/uploads/abf8018cf9e103f3d32dfb686efa946f/bubble_header_righttoleft_after.png)
This commit is contained in:
James Graham
2022-10-04 18:15:15 +00:00
parent 1a3befef36
commit 81bbfce7cd

View File

@@ -206,20 +206,16 @@ QQC2.ItemDelegate {
contentItem: ColumnLayout {
id: column
spacing: Kirigami.Units.smallSpacing
Item {
RowLayout {
id: rowLayout
spacing: Kirigami.Units.smallSpacing
visible: model.showAuthor && !isEmote
Layout.fillWidth: true
Layout.preferredWidth: nameLabel.implicitWidth + timeLabel.implicitWidth
Layout.maximumWidth: contentMaxWidth
implicitHeight: visible ? nameLabel.implicitHeight : 0
QQC2.Label {
id: nameLabel
topInset: 0
visible: model.showAuthor && !isEmote
width: Math.min(contentMaxWidth - timeLabel.width, implicitWidth)
Layout.maximumWidth: contentMaxWidth - timeLabel.implicitWidth - rowLayout.spacing
text: visible ? author.displayName : ""
textFormat: Text.PlainText
@@ -242,9 +238,7 @@ QQC2.ItemDelegate {
}
QQC2.Label {
id: timeLabel
leftPadding: Kirigami.Units.largeSpacing
anchors.left: nameLabel.right
visible: model.showAuthor && !isEmote
text: visible ? time.toLocaleTimeString(Qt.locale(), Locale.ShortFormat) : ""
color: Kirigami.Theme.disabledTextColor
QQC2.ToolTip.visible: hoverHandler.hovered