From ad494560fc0580c8e0aca4924826f67d34612c45 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 20 Jul 2021 14:39:15 +0200 Subject: [PATCH] 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. --- ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml | 1 + ui/StatusQ/src/StatusQ/Controls/StatusToolTip.qml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml index bc50e86ffb..dd786d8ea6 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml @@ -159,6 +159,7 @@ Rectangle { text: "Activity" orientation: StatusToolTip.Orientation.Bottom y: parent.height + 12 + arrow.x: width - (parent.width-4) } } diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusToolTip.qml b/ui/StatusQ/src/StatusQ/Controls/StatusToolTip.qml index d0984fac85..0c3755f0d9 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusToolTip.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusToolTip.qml @@ -15,6 +15,7 @@ ToolTip { property int maxWidth: 800 property int orientation: StatusToolTip.Orientation.Top + property alias arrow: arrow implicitWidth: Math.min(maxWidth, textContent.implicitWidth + 16) leftPadding: 8 @@ -32,6 +33,7 @@ ToolTip { anchors.bottomMargin: 8 } Rectangle { + id: arrow color: statusToolTipContentBackground.color height: 20 width: 20