From 0190247c5a60e24d01d541fdcb7ac19e0dbfce59 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Jun 2019 14:17:10 +0200 Subject: [PATCH] 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. --- resources/qml/ActionButton.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 905863a561..bb1abcf57e 100644 --- a/resources/qml/ActionButton.qml +++ b/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