From 04c5aef876dc4dbeff96f772254b6a7edb6d8433 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 19 Nov 2021 11:45:50 +0000 Subject: add placement to Popover popup_at_rect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iaa12a48f62037dd985d526993a07762b10bd0cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125474 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/app/salvtables.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 987a9ffe2aeb..e8f51950b04f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6698,7 +6698,8 @@ SalInstancePopover::SalInstancePopover(DockingWindow* pPopover, SalInstanceBuild SalInstancePopover::~SalInstancePopover() { signal_closed(); } -void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) +void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + weld::Placement ePlace) { SalInstanceWidget* pVclWidget = dynamic_cast(pParent); assert(pVclWidget); @@ -6712,8 +6713,12 @@ void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Recta aRect.SetRight(aPt.X()); aRect.SetBottom(aPt.Y()); - FloatWinPopupFlags nFlags = FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus - | FloatWinPopupFlags::NoMouseUpClose; + FloatWinPopupFlags nFlags = FloatWinPopupFlags::GrabFocus | FloatWinPopupFlags::NoMouseUpClose; + if (ePlace == weld::Placement::Under) + nFlags = nFlags | FloatWinPopupFlags::Down; + else + nFlags = nFlags | FloatWinPopupFlags::Right; + m_xPopover->EnableDocking(); DockingManager* pDockingManager = vcl::Window::GetDockingManager(); pDockingManager->SetPopupModeEndHdl(m_xPopover, -- cgit