diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-03-20 09:54:28 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-03-27 10:44:10 +0200 |
commit | f7de9714b00dd618544cf561d5ee45354623b947 (patch) | |
tree | 1ceb5940ae87ac45199c67ab510ac3626de78378 /sfx2 | |
parent | 04630f26d06c4d3ec22b2a8b97e6a5e69cc70d5e (diff) |
tdf#115786: Fix reopening undocked sidebar
while trying hard to keep tdf#88241 fixed. Had to introduce yet
another bool variable as now that previously active sidebar deck
is remembered (= it is visible when floating window opens) it's
impossible to tell whether sidebar was already opened or not
Change-Id: If2c9edfa2f9beb400537b106d3094f256b0cc183
Reviewed-on: https://gerrit.libreoffice.org/51866
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index ebe568093772..c7652bdf9e52 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -104,6 +104,7 @@ SidebarController::SidebarController ( maAsynchronousDeckSwitch(), mbIsDeckRequestedOpen(), mbIsDeckOpen(), + mbFloatingDeckClosed(!pParentWindow->IsFloatingMode()), mnSavedSidebarWidth(pParentWindow->GetSizePixel().Width()), maFocusManager([this](const Panel& rPanel){ return this->ShowPanel(rPanel); }), mxReadOnlyModeDispatch(), @@ -523,12 +524,17 @@ void SidebarController::OpenThenToggleDeck ( else if ( IsDeckVisible( rsDeckId ) ) { if ( pSplitWindow ) + { // tdf#67627 Clicking a second time on a Deck icon will close the Deck RequestCloseDeck(); - else + return; + } + else if( !WasFloatingDeckClosed() ) + { // tdf#88241 Summoning an undocked sidebar a second time should close sidebar mpParentWindow->Close(); - return; + return; + } } RequestOpenDeck(); SwitchToDeck(rsDeckId); diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 05e7a3ab41a9..097fd535e6fb 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -77,6 +77,12 @@ void SidebarDockingWindow::GetFocus() SfxDockingWindow::GetFocus(); } +bool SidebarDockingWindow::Close() +{ + mpSidebarController->SetFloatingDeckClosed( true ); + return SfxDockingWindow::Close(); +} + SfxChildAlignment SidebarDockingWindow::CheckAlignment ( SfxChildAlignment eCurrentAlignment, SfxChildAlignment eRequestedAlignment) |