Skip to content

Commit

Permalink
Decouple emoji field button from UserStatusSelectorButton
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 25, 2022
1 parent 948eacd commit fc484dc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/gui/UserStatusSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit fc484dc

Please sign in to comment.