[SMS App] Clean up runtime warning about undefined behavior

Summary: Move ColumnLayout containing text elements inside of the graphical bounding rectangle

Test Plan:
Pre patch:
 - Launch messaging app
 - Open conversation
 - Notice huge spew of warnings like: "qrc:/qml/ChatMessage.qml:84:5: QML ColumnLayout: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead."
Post patch:
 - Launch messaging app
 - Open conversation
 - No warnings about undefined behavior

Reviewers: apol

Reviewed By: apol

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16534
This commit is contained in:
Simon Redman 2018-10-31 08:47:06 -06:00
parent c546c77040
commit 70926fbeaf

View file

@ -79,28 +79,27 @@ RowLayout {
samples: 10
spread: 0.1
}
}
ColumnLayout {
id: content
spacing: 0
anchors.centerIn: box
ColumnLayout {
id: content
spacing: 0
anchors.centerIn: box
Controls.Label {
text: messageBody
textFormat: Text.PlainText
wrapMode: Text.Wrap
color: sentByMe ? Kirigami.Theme.buttonTextColor : Kirigami.Theme.complementaryTextColor
Layout.maximumWidth: root.width - Kirigami.Units.gridUnit * 6
}
RowLayout {
Controls.Label {
id: dateLabel
text: Qt.formatDateTime(dateTime, "dd. MMM yyyy, hh:mm")
color: Kirigami.Theme.disabledTextColor
font.pixelSize: Kirigami.Units.gridUnit * 0.8
text: messageBody
textFormat: Text.PlainText
wrapMode: Text.Wrap
color: sentByMe ? Kirigami.Theme.buttonTextColor : Kirigami.Theme.complementaryTextColor
Layout.maximumWidth: root.width - Kirigami.Units.gridUnit * 6
}
RowLayout {
Controls.Label {
id: dateLabel
text: Qt.formatDateTime(dateTime, "dd. MMM yyyy, hh:mm")
color: Kirigami.Theme.disabledTextColor
font.pixelSize: Kirigami.Units.gridUnit * 0.8
}
}
}
}