summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-05-22 11:48:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-22 20:22:40 +0100
commitf7b9c4e38733863da8e434157ff7061e6b110309 (patch)
tree04572ae01cd1ae10ef85cd36d87154a4ee06f87e
parent95ae39c0c34c9a5e6fa6e72bf3a631a9a799b872 (diff)
Resolves: #i122366# Uncheck sidebar menu button after menu is closed
(cherry picked from commit ac41d4c3e1972e3968ce9cf6949adc13e2b198e6) Change-Id: I4eef19a3b4ad9ea3ff7fd40b22c2854f569b69b6 (cherry picked from commit ff7bbe528aebedd41229e8d351a8c595e3627905)
-rw-r--r--sfx2/source/sidebar/MenuButton.cxx12
-rw-r--r--sfx2/source/sidebar/TabBar.cxx4
-rw-r--r--sfx2/source/sidebar/TabBar.hxx3
3 files changed, 6 insertions, 13 deletions
diff --git a/sfx2/source/sidebar/MenuButton.cxx b/sfx2/source/sidebar/MenuButton.cxx
index 0a5180e918b8..fc573cea6f6f 100644
--- a/sfx2/source/sidebar/MenuButton.cxx
+++ b/sfx2/source/sidebar/MenuButton.cxx
@@ -102,18 +102,12 @@ void MenuButton::MouseMove (const MouseEvent& rEvent)
void MenuButton::MouseButtonDown (const MouseEvent& rMouseEvent)
{
-#if 0
- Hide();
- CheckBox::MouseButtonDown(rMouseEvent);
- Show();
-#else
if (rMouseEvent.IsLeft())
{
mbIsLeftButtonDown = true;
CaptureMouse();
Invalidate();
}
-#endif
}
@@ -121,11 +115,6 @@ void MenuButton::MouseButtonDown (const MouseEvent& rMouseEvent)
void MenuButton::MouseButtonUp (const MouseEvent& rMouseEvent)
{
-#if 0
- Hide();
- CheckBox::MouseButtonUp(rMouseEvent);
- Show();
-#else
if (IsMouseCaptured())
ReleaseMouse();
@@ -143,7 +132,6 @@ void MenuButton::MouseButtonUp (const MouseEvent& rMouseEvent)
mbIsLeftButtonDown = false;
Invalidate();
}
-#endif
}
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 21beb0f548a7..1cbd18b544e6 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -363,6 +363,9 @@ void TabBar::UpdateFocusManager (FocusManager& rFocusManager)
IMPL_LINK(TabBar, OnToolboxClicked, void*, EMPTYARG)
{
+ if ( ! mpMenuButton)
+ return 0;
+
::std::vector<DeckMenuData> aMenuData;
for(ItemContainer::const_iterator iItem(maItems.begin()),iEnd(maItems.end());
@@ -388,6 +391,7 @@ IMPL_LINK(TabBar, OnToolboxClicked, void*, EMPTYARG)
mpMenuButton->GetPosPixel(),
mpMenuButton->GetSizePixel()),
aMenuData);
+ mpMenuButton->Check(sal_False);
return 0;
}
diff --git a/sfx2/source/sidebar/TabBar.hxx b/sfx2/source/sidebar/TabBar.hxx
index 7cecc42e68b1..cafd3e8aad7b 100644
--- a/sfx2/source/sidebar/TabBar.hxx
+++ b/sfx2/source/sidebar/TabBar.hxx
@@ -30,6 +30,7 @@
#include <boost/scoped_ptr.hpp>
class Button;
+class CheckBox;
class RadioButton;
namespace css = ::com::sun::star;
@@ -94,7 +95,7 @@ public:
private:
cssu::Reference<css::frame::XFrame> mxFrame;
- ::boost::scoped_ptr<Button> mpMenuButton;
+ ::boost::scoped_ptr<CheckBox> mpMenuButton;
class Item
{
public: