summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-27 13:01:46 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-27 20:22:34 +0100
commit19503a467f73e7a619b9fbd8e0c7a6cc9d8ba237 (patch)
tree846770fb01a69d36ed3a30d0acba37d5ca58084a /vcl
parent67e6aa6c59221fa8cd6768b82dbe0a46cf7d129a (diff)
get_active should be true when activated but menu not yet shown
Change-Id: Ia2a7cbf5b47eab6d09c78eb9d18233e18b628a3f Reviewed-on: https://gerrit.libreoffice.org/83905 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/control/menubtn.cxx14
2 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index b26f48579813..b7e974e02195 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2624,7 +2624,7 @@ public:
virtual bool get_active() const override
{
- return m_xMenuButton->MenuShown();
+ return m_xMenuButton->InPopupMode();
}
virtual void set_inconsistent(bool /*inconsistent*/) override
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);