From 4c328193cedc5c75154474eb68636c6dcacf1f16 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Tue, 21 Feb 2023 14:24:25 +0100 Subject: [PATCH] UserProfile: fix status message overflowing Also style the "Status:" prefix bold. --- resources/qml/dialogs/UserProfile.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml index cf627a88..c34ef2b5 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml @@ -179,15 +179,22 @@ ApplicationWindow { MatrixText { id: statusMsg - text: qsTr("Status: %1").arg(Presence.userStatus(profile.userid)) + text: updateStatus() visible: Presence.userStatus(profile.userid) != "" Layout.alignment: Qt.AlignHCenter - font.italic: true + Layout.fillWidth: true + horizontalAlignment: TextEdit.AlignHCenter + Layout.leftMargin: Nheko.paddingMedium + Layout.rightMargin: Nheko.paddingMedium font.pointSize: Math.floor(fontMetrics.font.pointSize * 0.9) + + function updateStatus(){ + return qsTr("Status: %1").arg(Presence.userStatus(profile.userid)) + } Connections { target: Presence function onPresenceChanged(id) { - if (id == profile.userid) statusMsg.text = Presence.userStatus(profile.userid); + if (id == profile.userid) statusMsg.text = statusMsg.updateStatus(); } } }