From 9836443d261ab488e58db25bf877c66725b367b0 Mon Sep 17 00:00:00 2001
From: tastytea <tastytea@tastytea.de>
Date: Sat, 5 Feb 2022 01:34:34 +0100
Subject: [PATCH] Add maximum width to room name in user profile

Layout is: spacing | text | spacing | button | spacing
Therefore we subtract 3x spacing and 1x button(16) from width.
---
 resources/qml/dialogs/UserProfile.qml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml
index 5f58f705e..60f1eb8da 100644
--- a/resources/qml/dialogs/UserProfile.qml
+++ b/resources/qml/dialogs/UserProfile.qml
@@ -187,6 +187,8 @@ ApplicationWindow {
                     text: qsTr("Room: %1").arg(profile.room ? profile.room.roomName : "")
                     ToolTip.text: qsTr("This is a room-specific profile. The user's name and avatar may be different from their global versions.")
                     ToolTip.visible: ma.hovered
+                    Layout.maximumWidth: parent.parent.width - (parent.spacing * 3) - 16
+                    horizontalAlignment: TextEdit.AlignHCenter
 
                     HoverHandler {
                         id: ma
-- 
GitLab