From fc484dca15bce0fc57de221b18fd745b220e12c7 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 25 Nov 2022 13:06:16 +0100 Subject: [PATCH] Decouple emoji field button from UserStatusSelectorButton Signed-off-by: Claudio Cambra --- src/gui/UserStatusSelector.qml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/gui/UserStatusSelector.qml b/src/gui/UserStatusSelector.qml index 01384380e83d6..80d22d61430ef 100644 --- a/src/gui/UserStatusSelector.qml +++ b/src/gui/UserStatusSelector.qml @@ -132,19 +132,19 @@ ColumnLayout { Layout.fillWidth: true spacing: 0 - UserStatusSelectorButton { + AbstractButton { id: fieldButton + readonly property bool showBorder: hovered || checked || emojiDialog.visible + Layout.preferredWidth: userStatusMessageTextField.height Layout.preferredHeight: userStatusMessageTextField.height text: userStatusSelectorModel.userStatusEmoji - onClicked: emojiDialog.open() - onHeightChanged: topButtonsLayout.maxButtonHeight = Math.max(topButtonsLayout.maxButtonHeight, height) - padding: 0 - z: hovered ? 2 : 0 // Make sure highlight is seen on top of text field + z: showBorder ? 2 : 0 // Make sure highlight is seen on top of text field + hoverEnabled: true property color borderColor: showBorder ? Style.ncBlue : Style.menuBorder @@ -176,6 +176,15 @@ ColumnLayout { color: Style.buttonBackgroundColor } } + + contentItem: Label { + text: fieldButton.text + textFormat: Text.PlainText + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + onClicked: emojiDialog.open() } Popup {