diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-06-19 16:40:38 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-07-03 17:46:55 +0200 |
commit | bf1e097c16f9dd672ea43234cbe0eb64c82fd37e (patch) | |
tree | b2d0cd211bc13e7225f8769e3c1fc3a28b7aa441 /vcl/source/control | |
parent | dd645e70108f31aab611634e77c120e5efe52d05 (diff) |
weld SwWatermarkDialog
Change-Id: Iff3ddfb4dd75088e39ea7675b085f1bbde2c2045
Reviewed-on: https://gerrit.libreoffice.org/56414
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/menubtn.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 0b47bf8dfac8..edf0df728ba0 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -73,6 +73,40 @@ void MenuButton::ExecuteMenu() } } +void MenuButton::CancelMenu() +{ + if (!mpMenu && !mpFloatingWindow) + return; + + if (mpMenu) + { + mpMenu->EndExecute(); + } + else + { + if (mpFloatingWindow->GetType() == WindowType::FLOATINGWINDOW) + static_cast<FloatingWindow*>(mpFloatingWindow.get())->EndPopupMode(); + else + vcl::Window::GetDockingManager()->EndPopupMode(mpFloatingWindow); + } +} + +bool MenuButton::MenuShown() const +{ + if (!mpMenu && !mpFloatingWindow) + return false; + + if (mpMenu) + return PopupMenu::GetActivePopupMenu() == mpMenu; + else + { + if (mpFloatingWindow->GetType() == WindowType::FLOATINGWINDOW) + return static_cast<const FloatingWindow*>(mpFloatingWindow.get())->IsInPopupMode(); + else + return vcl::Window::GetDockingManager()->IsInPopupMode(mpFloatingWindow); + } +} + OString MenuButton::GetCurItemIdent() const { return (mnCurItemId && mpMenu) ? |