summaryrefslogtreecommitdiff
path: root/sfx2/source/notebookbar
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-11-21 12:16:18 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-11-22 00:15:46 +0100
commit59cba4298dae0caf0f1ba72a830d8f4edf48756d (patch)
treef984de512f93130a01f3599e520ad879ec2f9b9a /sfx2/source/notebookbar
parent11e857374fb44a1a24fb07948e3ee300f09b6a11 (diff)
notebookbar: Pass menu button as parent for its menu
Use the Notebookbar menu button as parent for its menu. This also makes the button position be used as the reference. This allows to drop the now unused NotebookbarTabControlBase::GetHeaderHeight. Also, set the reference point to be at the bottom of the button, so the menu opens below it instead of approximately in the middle, which matches how other menu buttons behave. To test: Set "Tabbed" for the UI variant in "View" -> "User Interface", then click the "Hamburger menu" button in the notebookbar. Change-Id: I0717fad73ff7a42d2bdaaa53a73d055234003d3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176927 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'sfx2/source/notebookbar')
-rw-r--r--sfx2/source/notebookbar/NotebookbarTabControl.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
index 6b08a6a56e33..b8a82b8bb00f 100644
--- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx
+++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
@@ -349,8 +349,10 @@ IMPL_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebo
return;
xPopupController->setPopupMenu(xPopupMenu);
- Point aPos(pNotebookbar->GetSizePixel().getWidth(), NotebookbarTabControl::GetHeaderHeight() - ICON_SIZE + 10);
- xPopupMenu->execute(pNotebookbar->GetComponentInterface(),
+ Control* pOpenMenuButton = GetOpenMenu();
+ assert(pOpenMenuButton);
+ Point aPos(pOpenMenuButton->GetSizePixel().getWidth(), pOpenMenuButton->GetSizePixel().getHeight());
+ xPopupMenu->execute(pOpenMenuButton->GetComponentInterface(),
css::awt::Rectangle(aPos.X(), aPos.Y(), 1, 1),
css::awt::PopupMenuDirection::EXECUTE_DOWN);