summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-12-04 11:31:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-12-04 10:51:08 +0000
commitf0b969179d8583a98849b0b8df1e1f5f130b3fbf (patch)
tree85d6668392874992619a13020063ddaa1cd51d89
parent67bc4c4062b0aeb1135b658d25a23fcd90a82333 (diff)
fdo#85937 Add 'Close Sidebar' command to Sidebar menu
Change-Id: I83248398a9a8f2a8abb4e10d7ef9f1c203dddbf5 Reviewed-on: https://gerrit.libreoffice.org/13297 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sfx2/source/sidebar/Sidebar.hrc1
-rw-r--r--sfx2/source/sidebar/Sidebar.src4
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx11
3 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc
index 06d1e04c4def..a351c1ea05e6 100644
--- a/sfx2/source/sidebar/Sidebar.hrc
+++ b/sfx2/source/sidebar/Sidebar.hrc
@@ -52,6 +52,7 @@
#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL 132
#define STRING_CUSTOMIZATION 200
#define STRING_RESTORE 201
+#define STRING_HIDE_SIDEBAR 202
#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1)
#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2)
diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src
index 548fa0298eb8..eaa55c08d870 100644
--- a/sfx2/source/sidebar/Sidebar.src
+++ b/sfx2/source/sidebar/Sidebar.src
@@ -154,6 +154,10 @@ Resource RID_SIDEBAR_RESOURCE
{
Text [en-US] = "Restore Default";
};
+ String STRING_HIDE_SIDEBAR
+ {
+ Text [en-US] = "Close Sidebar";
+ };
};
String SFX_STR_SIDEBAR_MORE_OPTIONS
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index db09eea970e8..a0e05fc45f5e 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -66,6 +66,7 @@ using ::rtl::OUString;
namespace
{
const static char gsReadOnlyCommandName[] = ".uno:EditDoc";
+ const static char gsHideSidebarCommandName[] = ".uno:Sidebar";
const static sal_Int32 gnMaximumSidebarWidth (400);
const static sal_Int32 gnWidthCloseThreshold (70);
const static sal_Int32 gnWidthOpenThreshold (40);
@@ -81,6 +82,7 @@ namespace {
{
MID_UNLOCK_TASK_PANEL = 1,
MID_LOCK_TASK_PANEL,
+ MID_HIDE_SIDEBAR,
MID_CUSTOMIZATION,
MID_RESTORE_DEFAULT,
MID_FIRST_PANEL,
@@ -927,6 +929,7 @@ void SidebarController::ShowPopupMenu (
else
pMenu->InsertItem(MID_UNLOCK_TASK_PANEL, SFX2_RESSTR(STR_SFX_UNDOCK));
+ pMenu->InsertItem(MID_HIDE_SIDEBAR, SFX2_RESSTR(STRING_HIDE_SIDEBAR));
pCustomizationMenu->InsertSeparator();
pCustomizationMenu->InsertItem(MID_RESTORE_DEFAULT, SFX2_RESSTR(STRING_RESTORE));
@@ -965,6 +968,14 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu)
mpTabBar->RestoreHideFlags();
break;
+ case MID_HIDE_SIDEBAR:
+ {
+ const util::URL aURL (Tools::GetURL(gsHideSidebarCommandName));
+ Reference<frame::XDispatch> mxDispatch (Tools::GetDispatch(mxFrame, aURL));
+ if (mxDispatch.is())
+ mxDispatch->dispatch(aURL, Sequence<beans::PropertyValue>());
+ break;
+ }
default:
{
try