diff options
Diffstat (limited to 'vcl/source/control/menubtn.cxx')
-rw-r--r-- | vcl/source/control/menubtn.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 957c4f63bff3..7402d361f4b8 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -36,10 +36,15 @@ void MenuButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) void MenuButton::ExecuteMenu() { + mbStartingMenu = true; + Activate(); if (!mpMenu && !mpFloatingWindow) + { + mbStartingMenu = false; return; + } Size aSize = GetSizePixel(); SetPressed( true ); @@ -69,6 +74,9 @@ void MenuButton::ExecuteMenu() vcl::Window::GetDockingManager()->StartPopupMode(mpFloatingWindow, aRect, nFlags); } } + + mbStartingMenu = false; + SetPressed(false); if (mnCurItemId) { @@ -96,8 +104,11 @@ void MenuButton::CancelMenu() } } -bool MenuButton::MenuShown() const +bool MenuButton::InPopupMode() const { + if (mbStartingMenu) + return true; + if (!mpMenu && !mpFloatingWindow) return false; @@ -116,6 +127,7 @@ MenuButton::MenuButton( vcl::Window* pParent, WinBits nWinBits ) : PushButton(WindowType::MENUBUTTON) , mnCurItemId(0) , mbDelayMenu(false) + , mbStartingMenu(false) { mnDDStyle = PushButtonDropdownStyle::MenuButton; ImplInit(pParent, nWinBits); |