Ensure 'Sync now' button doesn't have its text elided
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 4 Nov 2022 12:05:55 +0000 (13:05 +0100)
committerClaudio Cambra <claudio.cambra@gmail.com>
Tue, 8 Nov 2022 15:32:04 +0000 (16:32 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/tray/ActivityActionButton.qml
src/gui/tray/CallNotificationDialog.qml
src/gui/tray/CustomButton.qml
src/gui/tray/NCButtonContents.qml
src/gui/tray/SyncStatus.qml

index 7741f4f16070ca03d1dc51ead06183c9db52f0b7..d13cb08362b56be22161524cb52423b1616bfad7 100644 (file)
@@ -71,7 +71,7 @@ AbstractButton {
             text: root.text
             textColor: root.textColor
             textColorHovered: root.textColorHovered
-            bold: root.primaryButton
+            font.bold: root.primaryButton
         }
     }
 }
index c942877add037d6e4186813539ebada89d77cc80..d53daf7bc36104996cdc74fe53447a0764f05964 100644 (file)
@@ -220,7 +220,7 @@ Window {
 
                         visible: isAnswerCallButton
                         text: modelData.label
-                        bold: true
+                        contentsFont.bold: true
                         bgColor: Style.ncBlue
                         bgNormalOpacity: 0.8
 
@@ -247,7 +247,7 @@ Window {
                 CustomButton {
                     id: declineCall
                     text: qsTr("Decline")
-                    bold: true
+                    contentsFont.bold: true
                     bgColor: Style.errorBoxBackgroundColor
                     bgNormalOpacity: 0.8
 
index f07acc31c463397a00d34e16d6e730519ca93612..3cdfd1491432e5727ef5d6b66ef2796214ac9b52 100644 (file)
@@ -15,10 +15,9 @@ Button {
     property color textColor: Style.ncTextColor
     property color textColorHovered: textColor
 
-    property alias bgColor: bgRectangle.color
-
-    property bool bold: false
+    property alias contentsFont: contents.font
 
+    property alias bgColor: bgRectangle.color
     property alias bgNormalOpacity: bgRectangle.normalOpacity
     property alias bgHoverOpacity: bgRectangle.hoverOpacity
 
@@ -37,12 +36,12 @@ Button {
     }
 
     contentItem: NCButtonContents {
+        id: contents
         hovered: root.hovered
         imageSourceHover: root.imageSourceHover
         imageSource: root.imageSource
         text: root.text
         textColor: root.textColor
         textColorHovered: root.textColorHovered
-        bold: root.bold
     }
 }
index 806cc0843e20258a3a266fec6f817b177c015de3..1e6231efd5717939f819b7f3e7cedfe59b1fd9ee 100644 (file)
@@ -28,7 +28,7 @@ RowLayout {
 
     property color textColor: Style.ncTextColor
     property color textColorHovered: textColor
-    property bool bold: false
+    property alias font: buttonLabel.font
 
     Image {
         id: icon
@@ -40,6 +40,8 @@ RowLayout {
     }
 
     Label {
+        id: buttonLabel
+
         Layout.maximumWidth: icon.width > 0 ? parent.width - icon.width - parent.spacing : parent.width
         Layout.fillWidth: icon.status !== Image.Ready
 
index b6ff2713ce70e0f1b6738cea7a966a5dcf796123..55da5589ba9a8cac3a63c97200f6be021dfd0ee8 100644 (file)
@@ -102,18 +102,19 @@ RowLayout {
     CustomButton {
         FontMetrics {
             id: syncNowFm
-            font.bold: true
+            font: parent.contentsFont
         }
 
-        Layout.preferredWidth: syncNowFm.boundingRect(text).width + leftPadding + rightPadding
+        Layout.preferredWidth: syncNowFm.boundingRect(text).width +
+                               leftPadding +
+                               rightPadding +
+                               Style.standardSpacing * 2
         Layout.rightMargin: Style.trayHorizontalMargin
 
-        FontMetrics { font.bold: true }
-
         text: qsTr("Sync now")
         textColor: Style.adjustedCurrentUserHeaderColor
         textColorHovered: Style.currentUserHeaderTextColor
-        bold: true
+        contentsFont.bold: true
         bgColor: Style.currentUserHeaderColor
 
         visible: !syncStatus.syncing &&