From 2815ad040801cd4a0a0d31a72299b699fb924737 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 4 Feb 2022 20:51:30 +0100 Subject: [PATCH 1/3] Fix width of room name to dialog width --- resources/qml/dialogs/RoomSettings.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/dialogs/RoomSettings.qml b/resources/qml/dialogs/RoomSettings.qml index 48d2e2b7..fad7b4c7 100644 --- a/resources/qml/dialogs/RoomSettings.qml +++ b/resources/qml/dialogs/RoomSettings.qml @@ -100,7 +100,8 @@ ApplicationWindow { MatrixText { text: roomSettings.roomName font.pixelSize: fontMetrics.font.pixelSize * 2 - Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + horizontalAlignment: TextEdit.AlignHCenter } MatrixText { From 721c315be249aad9b8552d44a02e1a4829fefe15 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 5 Feb 2022 00:45:14 +0100 Subject: [PATCH 2/3] 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 From 9836443d261ab488e58db25bf877c66725b367b0 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 5 Feb 2022 01:34:34 +0100 Subject: [PATCH 3/3] 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 5f58f705..60f1eb8d 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