From 721c315be249aad9b8552d44a02e1a4829fefe15 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 5 Feb 2022 00:45:14 +0100 Subject: [PATCH] Add maximum width to user name in profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layout is: padding | text | margin | button | padding Therefore we subtract 2x padding, 1x margin and 1x button from width. And an extra button for some reason. 🤷 --- resources/qml/dialogs/UserProfile.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml index 73c4e68b..5f58f705 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml @@ -138,6 +138,9 @@ ApplicationWindow { color: TimelineManager.userColor(profile.userid, Nheko.colors.window) font.bold: true Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: parent.width - (Nheko.paddingSmall * 2) - usernameChangeButton.anchors.leftMargin - (usernameChangeButton.width * 2) + horizontalAlignment: TextInput.AlignHCenter + wrapMode: TextInput.Wrap selectByMouse: true onAccepted: { profile.changeUsername(displayUsername.text); @@ -145,6 +148,7 @@ ApplicationWindow { } ImageButton { + id: usernameChangeButton visible: profile.isSelf anchors.leftMargin: Nheko.paddingSmall anchors.left: displayUsername.right