From 51b7c71dceeb67eb171dc556fc168295ce3ba889 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. --- src/StatusQ/Components/StatusChatToolBar.qml | 1 + src/StatusQ/Controls/StatusToolTip.qml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/StatusQ/Components/StatusChatToolBar.qml b/src/StatusQ/Components/StatusChatToolBar.qml index bc50e86f..dd786d8e 100644 --- a/src/StatusQ/Components/StatusChatToolBar.qml +++ b/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/src/StatusQ/Controls/StatusToolTip.qml b/src/StatusQ/Controls/StatusToolTip.qml index d0984fac..0c3755f0 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 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