HToolTip: fix binding loop

This commit is contained in:
miruka 2019-09-11 16:47:13 -04:00
parent 0e6b6c830d
commit 2e3d21aa31

View File

@ -1,15 +1,11 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
ToolTip { ToolTip {
id: toolTip id: toolTip
delay: theme.controls.toolTip.delay delay: theme.controls.toolTip.delay
padding: background.border.width padding: background.border.width
contentWidth: Math.min(
mainUI.width / 1.25,
// contentItem.implicitWidth,
theme.fontSize.normal * 0.5 * 75,
)
property alias label: label property alias label: label
@ -22,17 +18,22 @@ ToolTip {
border.width: theme.controls.toolTip.borderWidth border.width: theme.controls.toolTip.borderWidth
} }
contentItem: HLabel { contentItem: HRowLayout {
HLabel {
id: label id: label
color: theme.controls.toolTip.text color: theme.controls.toolTip.text
text: toolTip.text text: toolTip.text
wrapMode: Text.Wrap wrapMode: Text.Wrap
property var pr: width
leftPadding: theme.spacing / 1.5 leftPadding: theme.spacing / 1.5
rightPadding: leftPadding rightPadding: leftPadding
topPadding: theme.spacing / 2 topPadding: theme.spacing / 2
bottomPadding: topPadding bottomPadding: topPadding
Layout.maximumWidth: Math.min(
mainUI.width / 1.25, theme.fontSize.normal * 0.5 * 75,
)
}
} }
enter: Transition { enter: Transition {