From ee4296837a8d829a8c0b8ed41e749dc6588e43fa Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Thu, 12 Aug 2021 16:29:36 +0200 Subject: [PATCH] feat(StatusToolTip): Adding an offset property Added an offset property with which the arrow position for the tooltip can be adjusted from the outside --- src/StatusQ/Controls/StatusToolTip.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/StatusQ/Controls/StatusToolTip.qml b/src/StatusQ/Controls/StatusToolTip.qml index 0c3755f0..3c40779d 100644 --- a/src/StatusQ/Controls/StatusToolTip.qml +++ b/src/StatusQ/Controls/StatusToolTip.qml @@ -15,6 +15,7 @@ ToolTip { property int maxWidth: 800 property int orientation: StatusToolTip.Orientation.Top + property int offset: 0 property alias arrow: arrow implicitWidth: Math.min(maxWidth, textContent.implicitWidth + 16) @@ -41,13 +42,13 @@ ToolTip { radius: 1 x: { if (orientation === StatusToolTip.Orientation.Top || orientation === StatusToolTip.Orientation.Bottom) { - return statusToolTipBackground.width / 2 - width / 2 + return statusToolTipBackground.width / 2 - width / 2 + offset } if (orientation === StatusToolTip.Orientation.Left) { - return statusToolTipContentBackground.width - (width / 2) - 8 + return statusToolTipContentBackground.width - (width / 2) - 8 + offset } if (orientation === StatusToolTip.Orientation.Right) { - return -width/2 + 8 + return -width/2 + 8 + offset } } y: {