diff options
Diffstat (limited to 'src/imports/controls/imagine/ToolTip.qml')
-rw-r--r-- | src/imports/controls/imagine/ToolTip.qml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/imports/controls/imagine/ToolTip.qml b/src/imports/controls/imagine/ToolTip.qml index 81a5e8aa..2bcb4fa8 100644 --- a/src/imports/controls/imagine/ToolTip.qml +++ b/src/imports/controls/imagine/ToolTip.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ToolTip { id: control @@ -45,10 +45,10 @@ T.ToolTip { x: parent ? (parent.width - implicitWidth) / 2 : 0 - (background ? background.leftInset : 0) y: -implicitHeight - (background ? background.topInset : 0) - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topMargin: background ? background.topInset : 0 leftMargin: background ? background.leftInset : 0 @@ -60,6 +60,11 @@ T.ToolTip { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent contentItem: Text { @@ -70,10 +75,6 @@ T.ToolTip { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "tooltip-background" NinePatchImageSelector on source { states: [ |