From 2e3d21aa31bfd2a02becafb8da60e9ba36ba34ba Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 11 Sep 2019 16:47:13 -0400 Subject: [PATCH] HToolTip: fix binding loop --- src/qml/Base/HToolTip.qml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/qml/Base/HToolTip.qml b/src/qml/Base/HToolTip.qml index 212a8b40..0a1d9ce7 100644 --- a/src/qml/Base/HToolTip.qml +++ b/src/qml/Base/HToolTip.qml @@ -1,15 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 ToolTip { id: toolTip delay: theme.controls.toolTip.delay padding: background.border.width - contentWidth: Math.min( - mainUI.width / 1.25, - // contentItem.implicitWidth, - theme.fontSize.normal * 0.5 * 75, - ) property alias label: label @@ -22,17 +18,22 @@ ToolTip { border.width: theme.controls.toolTip.borderWidth } - contentItem: HLabel { - id: label - color: theme.controls.toolTip.text - text: toolTip.text - wrapMode: Text.Wrap - property var pr: width + contentItem: HRowLayout { + HLabel { + id: label + color: theme.controls.toolTip.text + text: toolTip.text + wrapMode: Text.Wrap - leftPadding: theme.spacing / 1.5 - rightPadding: leftPadding - topPadding: theme.spacing / 2 - bottomPadding: topPadding + leftPadding: theme.spacing / 1.5 + rightPadding: leftPadding + topPadding: theme.spacing / 2 + bottomPadding: topPadding + + Layout.maximumWidth: Math.min( + mainUI.width / 1.25, theme.fontSize.normal * 0.5 * 75, + ) + } } enter: Transition {