From dc5e5d648b194d006b6b2ed403552b915965286a Mon Sep 17 00:00:00 2001 From: Alexandra Betouni <31625338+alexandraB99@users.noreply.github.com> Date: Wed, 18 Aug 2021 16:06:27 +0300 Subject: [PATCH] fix(StatusChatInputButton) ensure button text is elided correctly Closes #335 --- .../src/StatusQ/Components/StatusChatToolBar.qml | 3 ++- .../src/StatusQ/Controls/StatusChatInfoButton.qml | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml index af8abb1e70..019863e069 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml @@ -37,6 +37,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: 12 + anchors.right: actionButtons.left onClicked: statusChatToolBar.chatInfoButtonClicked() } @@ -45,7 +46,7 @@ Rectangle { anchors.right: parent.right anchors.rightMargin: 8 anchors.verticalCenter: parent.verticalCenter - + width: childrenRect.width spacing: 8 StatusFlatRoundButton { diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusChatInfoButton.qml b/ui/StatusQ/src/StatusQ/Controls/StatusChatInfoButton.qml index a434d1d256..636fbfc28f 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusChatInfoButton.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusChatInfoButton.qml @@ -102,8 +102,7 @@ Rectangle { anchors.topMargin: statusChatInfoButtonSubTitle.visible ? 0 : 8 anchors.left: identicon.right anchors.leftMargin: 8 - - width: statusIcon.width + chatName.anchors.leftMargin + chatName.width + (mutedIcon.visible ? mutedIcon.width + mutedIcon.anchors.leftMargin : 0) + anchors.right: parent.right height: chatName.height StatusIcon { @@ -138,7 +137,8 @@ Rectangle { anchors.left: statusIcon.visible ? statusIcon.right : parent.left anchors.leftMargin: statusIcon.visible ? 1 : 0 anchors.top: parent.top - + anchors.right: parent.right + elide: Text.ElideRight text: statusChatInfoButton.type === StatusChatInfoButton.Type.PublicChat && !statusChatInfoButton.title.startsWith("#") ? "#" + statusChatInfoButton.title : @@ -180,13 +180,15 @@ Rectangle { Item { id: statusChatInfoButtonSubTitle anchors.left: statusChatInfoButtonTitle.left + anchors.right: parent.right anchors.top: statusChatInfoButtonTitle.bottom visible: !!statusChatInfoButton.subTitle || statusChatInfoButton.pinnedMessagesCount > 0 height: visible ? chatType.height : 0 - width: childrenRect.width StatusBaseText { id: chatType + width: parent.width + elide: Text.ElideRight text: statusChatInfoButton.subTitle color: Theme.palette.baseColor1 font.pixelSize: 12