feat(StatusToolTip): Adding an offset property
Added an offset property with which the arrow position for the tooltip can be adjusted from the outside
This commit is contained in:
parent
87ae7b90e7
commit
ee4296837a
|
@ -15,6 +15,7 @@ ToolTip {
|
||||||
|
|
||||||
property int maxWidth: 800
|
property int maxWidth: 800
|
||||||
property int orientation: StatusToolTip.Orientation.Top
|
property int orientation: StatusToolTip.Orientation.Top
|
||||||
|
property int offset: 0
|
||||||
property alias arrow: arrow
|
property alias arrow: arrow
|
||||||
|
|
||||||
implicitWidth: Math.min(maxWidth, textContent.implicitWidth + 16)
|
implicitWidth: Math.min(maxWidth, textContent.implicitWidth + 16)
|
||||||
|
@ -41,13 +42,13 @@ ToolTip {
|
||||||
radius: 1
|
radius: 1
|
||||||
x: {
|
x: {
|
||||||
if (orientation === StatusToolTip.Orientation.Top || orientation === StatusToolTip.Orientation.Bottom) {
|
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) {
|
if (orientation === StatusToolTip.Orientation.Left) {
|
||||||
return statusToolTipContentBackground.width - (width / 2) - 8
|
return statusToolTipContentBackground.width - (width / 2) - 8 + offset
|
||||||
}
|
}
|
||||||
if (orientation === StatusToolTip.Orientation.Right) {
|
if (orientation === StatusToolTip.Orientation.Right) {
|
||||||
return -width/2 + 8
|
return -width/2 + 8 + offset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
y: {
|
y: {
|
||||||
|
|
Loading…
Reference in New Issue