From f643f19af63c649bd94d292cc627eb6ec177c479 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Tue, 13 Jul 2021 17:30:30 +0200 Subject: [PATCH] Fix tooltip not shown when the tooltip text is too long When the tooltip text is too long and the tooltip width ends up being longer than the window it is supposed to be drawn into, the tooltip is not drawn at all. This commit fixed that by allowing the tooltip width of the ActionButton to be changed within QML, limiting it to a certain size that fits the purpose. CURA-8112 --- plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml | 1 + resources/qml/ActionButton.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index 0f8544285f..b638082853 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -67,6 +67,7 @@ Item text: "Upgrade plan" visible: createNewProjectButtonVisible && !manager.userAccountCanCreateNewLibraryProject && (manager.retrievingProjectsStatus == DF.RetrievalStatus.Success || manager.retrievingProjectsStatus == DF.RetrievalStatus.Failed) tooltip: "You have reached the maximum number of projects allowed by your subscription. Please upgrade to the Professional subscription to create more projects." + tooltipWidth: parent.width * 3 / 4 onClicked: Qt.openUrlExternally("https://ultimaker.com/software/enterprise-software") } diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 31d5c35d2c..582df3d87c 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -18,6 +18,7 @@ Button property alias textFont: buttonText.font property alias cornerRadius: backgroundRect.radius property alias tooltip: tooltip.tooltipText + property alias tooltipWidth: tooltip.width property color color: UM.Theme.getColor("primary") property color hoverColor: UM.Theme.getColor("primary_hover")