summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-19 11:45:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-19 21:47:54 +0100
commit04c5aef876dc4dbeff96f772254b6a7edb6d8433 (patch)
tree10bcf57c81b2f27c1c3cf072c4dbb9d2ab0aaefb /vcl/source/app
parent2ed0c2f7ce1ac80dd0315043eb656fff41f24bfc (diff)
add placement to Popover popup_at_rect
Change-Id: Iaa12a48f62037dd985d526993a07762b10bd0cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx11
1 files changed, 8 insertions, 3 deletions
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<SalInstanceWidget*>(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,