Fix predefined status text formatting
authorClaudio Cambra <claudio.cambra@gmail.com>
Thu, 29 Sep 2022 17:37:55 +0000 (19:37 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Fri, 30 Sep 2022 14:24:36 +0000 (16:24 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
src/gui/PredefinedStatusButton.qml
src/gui/UserStatusSelector.qml

index 929b246d3aceedfd5c14fe9a23625e326784543f..416f7e752a5b21d55c5de44f2159a8aa115d7756 100644 (file)
@@ -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"
@@ -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
+            }
         }
     }
 }
index f7ec750270ffcca966b3ca01052e4693422b20c7..e7c40e44616f031d206ec25881492fb2938e1595 100644 (file)
@@ -261,7 +261,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)
                 }
             }
@@ -303,7 +304,7 @@ ColumnLayout {
         width: parent.width
 
         visible: userStatusSelectorModel.errorMessage != ""
-        text: "<b>Error:</b> " + userStatusSelectorModel.errorMessage
+        text: "Error: " + userStatusSelectorModel.errorMessage
     }
 
     RowLayout {