feat(StatusToolTip): expose `arrow` for fine-grain control
There's cases where the arrow on the tooltip needs to be repositioned, for example when the tooltip doesn't fit into the viewport anymore but is centered below a button.
This commit is contained in:
parent
031319968d
commit
51b7c71dce
|
@ -159,6 +159,7 @@ Rectangle {
|
||||||
text: "Activity"
|
text: "Activity"
|
||||||
orientation: StatusToolTip.Orientation.Bottom
|
orientation: StatusToolTip.Orientation.Bottom
|
||||||
y: parent.height + 12
|
y: parent.height + 12
|
||||||
|
arrow.x: width - (parent.width-4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 alias arrow: arrow
|
||||||
|
|
||||||
implicitWidth: Math.min(maxWidth, textContent.implicitWidth + 16)
|
implicitWidth: Math.min(maxWidth, textContent.implicitWidth + 16)
|
||||||
leftPadding: 8
|
leftPadding: 8
|
||||||
|
@ -32,6 +33,7 @@ ToolTip {
|
||||||
anchors.bottomMargin: 8
|
anchors.bottomMargin: 8
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: arrow
|
||||||
color: statusToolTipContentBackground.color
|
color: statusToolTipContentBackground.color
|
||||||
height: 20
|
height: 20
|
||||||
width: 20
|
width: 20
|
||||||
|
|
Loading…
Reference in New Issue