fix(StatusMessage): stickers were not aligned correctly

Closes #8944
This commit is contained in:
Alexandra Betouni 2023-01-12 14:19:36 +02:00 committed by Jonathan Rainville
parent 763041dab5
commit 0fb954b640
3 changed files with 11 additions and 5 deletions

View File

@ -140,10 +140,9 @@ Control {
contentItem: Item { contentItem: Item {
implicitWidth: messageLayout.implicitWidth implicitWidth: parent.width
implicitHeight: messageLayout.implicitHeight implicitHeight: messageLayout.implicitHeight
SequentialAnimation { SequentialAnimation {
id: messageFoundAnimation id: messageFoundAnimation
@ -182,7 +181,8 @@ Control {
ColumnLayout { ColumnLayout {
id: messageLayout id: messageLayout
anchors.fill: parent width: parent.width
height: childrenRect.height
spacing: 2 spacing: 2
Loader { Loader {
@ -202,6 +202,7 @@ Control {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
Layout.preferredHeight: childrenRect.height
spacing: 8 spacing: 8
StatusSmartIdenticon { StatusSmartIdenticon {
@ -226,6 +227,7 @@ Control {
spacing: 2 spacing: 2
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
Layout.leftMargin: profileImage.visible ? 0 : root.messageDetails.sender.profileImage.assetSettings.width + parent.spacing Layout.leftMargin: profileImage.visible ? 0 : root.messageDetails.sender.profileImage.assetSettings.width + parent.spacing
StatusPinMessageDetails { StatusPinMessageDetails {
@ -253,7 +255,9 @@ Control {
} }
Loader { Loader {
Layout.fillWidth: true Layout.fillWidth: true
active: !root.editMode && !!root.messageDetails.messageText && !root.hideMessage active: (!root.editMode && !!root.messageDetails.messageText && !root.hideMessage
&& ((root.messageDetails.contentType === StatusMessage.ContentType.Text)
|| (root.messageDetails.contentType === StatusMessage.ContentType.Emoji)))
visible: active visible: active
sourceComponent: StatusTextMessage { sourceComponent: StatusTextMessage {
objectName: "StatusMessage_textMessage" objectName: "StatusMessage_textMessage"

View File

@ -363,6 +363,8 @@ Loader {
StatusMessage { StatusMessage {
id: delegate id: delegate
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 2
Layout.bottomMargin: 2
function convertContentType(value) { function convertContentType(value) {
switch (value) { switch (value) {