From fe8b0bc2434bac9e8ee3b787fb9aced2bcfb5348 Mon Sep 17 00:00:00 2001
From: Ming Rui Zhang <mingrui.zhang@savoirfairelinux.com>
Date: Fri, 28 May 2021 11:10:16 -0400
Subject: [PATCH] misc: improvement for push button and change from "mozaic" to
 "mosaic"

Change-Id: Id1ad050af02a3833dc4099d7246fa81b4903f17d
---
 ...c_black_24dp.svg => mosaic_black_24dp.svg} |  0
 resources.qrc                                 |  2 +-
 src/commoncomponents/PushButton.qml           |  4 ++-
 src/constant/JamiStrings.qml                  |  2 +-
 src/constant/JamiTheme.qml                    | 18 +++++-----
 src/mainview/components/MainOverlay.qml       | 34 +++++++++----------
 6 files changed, 31 insertions(+), 29 deletions(-)
 rename images/icons/{mozaic_black_24dp.svg => mosaic_black_24dp.svg} (100%)

diff --git a/images/icons/mozaic_black_24dp.svg b/images/icons/mosaic_black_24dp.svg
similarity index 100%
rename from images/icons/mozaic_black_24dp.svg
rename to images/icons/mosaic_black_24dp.svg
diff --git a/resources.qrc b/resources.qrc
index 5adc05f09..89cba5ce6 100644
--- a/resources.qrc
+++ b/resources.qrc
@@ -6,7 +6,7 @@
         <file>images/jami_rolling_spinner.gif</file>
         <file>images/icons/baseline-close-24px.svg</file>
         <file>images/icons/cross_black_24dp.svg</file>
-        <file>images/icons/mozaic_black_24dp.svg</file>
+        <file>images/icons/mosaic_black_24dp.svg</file>
         <file>images/icons/baseline-done-24px.svg</file>
         <file>images/icons/baseline-error_outline-24px.svg</file>
         <file>projectcredits.html</file>
diff --git a/src/commoncomponents/PushButton.qml b/src/commoncomponents/PushButton.qml
index f9481e5b7..5d9710aa1 100644
--- a/src/commoncomponents/PushButton.qml
+++ b/src/commoncomponents/PushButton.qml
@@ -124,7 +124,8 @@ AbstractButton {
     Text {
         id: textContent
 
-        anchors.left: image.right
+        anchors.centerIn: image.status !== Image.Null ? undefined : root
+        anchors.left: image.status !== Image.Null ? image.right : undefined
         anchors.leftMargin: preferredMargin
         anchors.verticalCenter: root.verticalCenter
 
@@ -134,6 +135,7 @@ AbstractButton {
         visible: text ? true : false
 
         horizontalAlignment: Text.AlignHCenter
+        verticalAlignment: Text.AlignVCenter
 
         color: JamiTheme.primaryForegroundColor
         font.kerning: true
diff --git a/src/constant/JamiStrings.qml b/src/constant/JamiStrings.qml
index 073347be2..fba9b4ced 100644
--- a/src/constant/JamiStrings.qml
+++ b/src/constant/JamiStrings.qml
@@ -197,7 +197,7 @@ Item {
     property string addParticipants: qsTr("Add participants")
     property string chat: qsTr("Chat")
     property string moreOptions: qsTr("More options")
-    property string mozaic: qsTr("Mozaic")
+    property string mosaic: qsTr("Mosaic")
 
     // CallViewContextMenu
     property string hold: qsTr("Hold")
diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml
index 7bc536985..d5ae86bdd 100644
--- a/src/constant/JamiTheme.qml
+++ b/src/constant/JamiTheme.qml
@@ -91,7 +91,7 @@ Item {
     property color acceptGreenTransparency: rgba256(11, 130, 113, 56)
     property color refuseRed: rgba256(204, 0, 34, 100)
     property color refuseRedTransparent: rgba256(204, 0, 34, 56)
-    property color mozaicButtonNormalColor: "#272727"
+    property color mosaicButtonNormalColor: "#272727"
 
     property color closeButtonLighterBlack: "#4c4c4c"
 
@@ -205,14 +205,14 @@ Item {
     property int participantCallInStatusFontSize: 9
     property int participantCallInStatusTextWidthLimit: 100
     property int participantCallInStatusTextWidth: 68
-    property int mozaicButtonRadius: 5
-    property int mozaicButtonPreferredMargin: 5
-    property real mozaicButtonOpacity: 0.77
-    property int mozaicButtonTextPreferredWidth: 40
-    property int mozaicButtonTextPreferredHeight: 16
-    property int mozaicButtonTextPointSize: 8
-    property int mozaicButtonPreferredWidth: 70
-    property int mozaicButtonMaxWidth: 100
+    property int mosaicButtonRadius: 5
+    property int mosaicButtonPreferredMargin: 5
+    property real mosaicButtonOpacity: 0.77
+    property int mosaicButtonTextPreferredWidth: 40
+    property int mosaicButtonTextPreferredHeight: 16
+    property int mosaicButtonTextPointSize: 8
+    property int mosaicButtonPreferredWidth: 70
+    property int mosaicButtonMaxWidth: 100
 
     property real maximumWidthSettingsView: 600
     property real settingsHeaderpreferredHeight: 64
diff --git a/src/mainview/components/MainOverlay.qml b/src/mainview/components/MainOverlay.qml
index a7faeefe2..31af56bb7 100644
--- a/src/mainview/components/MainOverlay.qml
+++ b/src/mainview/components/MainOverlay.qml
@@ -135,42 +135,42 @@ Item {
             }
 
             PushButton {
-                id: mozaicButton
+                id: mosaicButton
 
                 Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
-                Layout.preferredWidth: JamiTheme.mozaicButtonPreferredWidth
+                Layout.preferredWidth: JamiTheme.mosaicButtonPreferredWidth
                 Layout.preferredHeight: 30
                 Layout.rightMargin: 5
 
                 visible: isConferenceCall && !isGrid
 
-                preferredMargin: JamiTheme.mozaicButtonPreferredMargin
-                radius: JamiTheme.mozaicButtonRadius
-                opacity: JamiTheme.mozaicButtonOpacity
+                preferredMargin: JamiTheme.mosaicButtonPreferredMargin
+                radius: JamiTheme.mosaicButtonRadius
+                opacity: JamiTheme.mosaicButtonOpacity
 
-                buttonText: JamiStrings.mozaic
+                buttonText: JamiStrings.mosaic
                 buttonTextColor: JamiTheme.whiteColor
-                buttonTextHeight: JamiTheme.mozaicButtonTextPreferredHeight
+                buttonTextHeight: JamiTheme.mosaicButtonTextPreferredHeight
                 buttonTextFont.weight: Font.DemiBold
-                buttonTextFont.pointSize: JamiTheme.mozaicButtonTextPointSize
+                buttonTextFont.pointSize: JamiTheme.mosaicButtonTextPointSize
                 textHAlign: Text.AlignLeft
 
                 imageColor: JamiTheme.whiteColor
                 imageContainerHeight: 20
                 imageContainerWidth: 20
-                source: "qrc:/images/icons/mozaic_black_24dp.svg"
+                source: "qrc:/images/icons/mosaic_black_24dp.svg"
 
-                normalColor: JamiTheme.mozaicButtonNormalColor
+                normalColor: JamiTheme.mosaicButtonNormalColor
                 onButtonTextWidthChanged: {
-                    if (buttonTextWidth > JamiTheme.mozaicButtonTextPreferredWidth) {
-                        if (mozaicButton.Layout.preferredWidth + buttonTextWidth
-                                - JamiTheme.mozaicButtonTextPreferredWidth
-                                > JamiTheme.mozaicButtonMaxWidth) {
-                            mozaicButton.Layout.preferredWidth = JamiTheme.mozaicButtonMaxWidth
+                    if (buttonTextWidth > JamiTheme.mosaicButtonTextPreferredWidth) {
+                        if (mosaicButton.Layout.preferredWidth + buttonTextWidth
+                                - JamiTheme.mosaicButtonTextPreferredWidth
+                                > JamiTheme.mosaicButtonMaxWidth) {
+                            mosaicButton.Layout.preferredWidth = JamiTheme.mosaicButtonMaxWidth
                             buttonTextEnableElide = true
                         } else
-                            mozaicButton.Layout.preferredWidth += buttonTextWidth
-                                    - JamiTheme.mozaicButtonTextPreferredWidth
+                            mosaicButton.Layout.preferredWidth += buttonTextWidth
+                                    - JamiTheme.mosaicButtonTextPreferredWidth
                     }
                 }
 
-- 
GitLab