Skip to content

Commit

Permalink
Merge pull request #5058 from nextcloud/backport/4987/stable-3.6
Browse files Browse the repository at this point in the history
[stable-3.6] Fix predefined status text formatting
  • Loading branch information
mgallien authored Oct 18, 2022
2 parents e13b7fa + 426e6cd commit 6a4b83e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
29 changes: 24 additions & 5 deletions src/gui/PredefinedStatusButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ AbstractButton {
property int emojiWidth: -1
property int internalSpacing: Style.standardSpacing
property string emoji: ""
property string statusText: ""
property string clearAtText: ""

background: Rectangle {
color: root.hovered || root.checked ? Style.lightHover : "transparent"
Expand All @@ -48,11 +50,28 @@ AbstractButton {
verticalAlignment: Image.AlignVCenter
}

Label {
text: root.text
textFormat: Text.PlainText
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
Row {
spacing: Style.smallSpacing
Label {
text: root.statusText
textFormat: Text.PlainText
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
font.bold: true
}

Label {
text: "-"
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
}

Label {
text: root.clearAtText
textFormat: Text.PlainText
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
}
}
}
}
5 changes: 3 additions & 2 deletions src/gui/UserStatusSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ ColumnLayout {
internalSpacing: statusFieldLayout.spacing + userStatusMessageTextField.leftPadding

emoji: modelData.icon
text: "<b>%1</b> – %2".arg(modelData.message).arg(userStatusSelectorModel.clearAtReadable(modelData))
statusText: modelData.message
clearAtText: userStatusSelectorModel.clearAtReadable(modelData)
onClicked: userStatusSelectorModel.setPredefinedStatus(modelData)
}
}
Expand Down Expand Up @@ -304,7 +305,7 @@ ColumnLayout {
width: parent.width

visible: userStatusSelectorModel.errorMessage != ""
text: "<b>Error:</b> " + userStatusSelectorModel.errorMessage
text: "Error: " + userStatusSelectorModel.errorMessage
}

RowLayout {
Expand Down

0 comments on commit 6a4b83e

Please sign in to comment.