]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Decouple emoji field button from UserStatusSelectorButton
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 25 Nov 2022 12:06:16 +0000 (13:06 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 21 Nov 2024 05:21:00 +0000 (13:21 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/UserStatusSelector.qml

index cdac7e9d770ed5f4a7aeda09c4dd5d76be8adfff..e20f58890537a9bfeb91cadfe81d5fe3305d07c8 100644 (file)
@@ -130,20 +130,18 @@ 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)
-
-                primary: true
                 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 : palette.dark
 
@@ -175,6 +173,15 @@ ColumnLayout {
                         color: palette.button
                     }
                 }
+
+                contentItem: Label {
+                    text: fieldButton.text
+                    textFormat: Text.PlainText
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
+                }
+
+                onClicked: emojiDialog.open()
             }
 
             Popup {