Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alignment of predefined status contents regardless of emoji fonts #4845

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/gui/PredefinedStatusButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ AbstractButton {
leftPadding: Style.standardSpacing / 2
rightPadding: Style.standardSpacing / 2

property real internalSpacing: Style.standardSpacing
property int emojiWidth: -1
property int internalSpacing: Style.standardSpacing
property string emoji: ""

background: Rectangle {
Expand All @@ -37,15 +38,19 @@ AbstractButton {
}

contentItem: Row {
spacing: internalSpacing
spacing: root.internalSpacing

Label {
width: root.emojiWidth > 0 ? root.emojiWidth : implicitWidth
text: emoji
horizontalAlignment: Image.AlignHCenter
verticalAlignment: Image.AlignVCenter
}

Label {
text: root.text
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
}
}
}
7 changes: 5 additions & 2 deletions src/gui/UserStatusSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ ColumnLayout {
}

RowLayout {
id: statusFieldLayout
Layout.fillWidth: true
spacing: 0

Expand Down Expand Up @@ -264,9 +265,11 @@ ColumnLayout {
model: userStatusSelectorModel.predefinedStatuses

PredefinedStatusButton {
id: control
Layout.fillWidth: true
internalSpacing: Style.standardSpacing + fieldButton.padding + userStatusMessageTextField.padding

leftPadding: 0
emojiWidth: fieldButton.width
internalSpacing: statusFieldLayout.spacing + userStatusMessageTextField.leftPadding

emoji: modelData.icon
text: "<b>%1</b> – %2".arg(modelData.message).arg(userStatusSelectorModel.clearAtReadable(modelData))
Expand Down