Browse Source

Don't show tooltip if it shows the same text as the button

It's only useful if the text on the button gets elided.
Ghostkeeper 5 years ago
parent
commit
0190247c5a
1 changed files with 10 additions and 1 deletions
  1. 10 1
      resources/qml/ActionButton.qml

+ 10 - 1
resources/qml/ActionButton.qml

@@ -67,6 +67,15 @@ Button
             anchors.verticalCenter: parent.verticalCenter
         }
 
+        TextMetrics
+        {
+            id: buttonTextMetrics
+            text: buttonText.text
+            font: buttonText.font
+            elide: buttonText.elide
+            elideWidth: buttonText.width
+        }
+
         Label
         {
             id: buttonText
@@ -124,7 +133,7 @@ Button
     Cura.ToolTip
     {
         id: tooltip
-        visible: button.hovered
+        visible: button.hovered && buttonTextMetrics.elidedText != buttonText.text
     }
 
     BusyIndicator