diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-12-09 17:27:48 -0500 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-26 20:17:22 +0200 |
commit | 682a91a9c8822a6cfb5377b26facea2572f34027 (patch) | |
tree | 9fb7d3c43b5068fad2c56b4067afcb0af221f67f /sfx2 | |
parent | 937440b65368e832a9e9fba92dfdb2efec4e06b5 (diff) |
sfx: LOK: toggle sidebar decks
Change-Id: I0559a2a4ae041bc61cf3a2d5979656a7941f4b02
Reviewed-on: https://gerrit.libreoffice.org/73518
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Sidebar.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx index 855da3113a36..ed12c0829302 100644 --- a/sfx2/source/sidebar/Sidebar.cxx +++ b/sfx2/source/sidebar/Sidebar.cxx @@ -51,6 +51,28 @@ void Sidebar::ShowPanel ( pController->GetFocusManager().GrabFocusPanel(); } +void Sidebar::TogglePanel ( + const OUString& rsPanelId, + const css::uno::Reference<frame::XFrame>& rxFrame) +{ + SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame); + if (!pController) + return; + + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); + + if (!xPanelDescriptor) + return; + + // This should be a lot more sophisticated: + // - Make the deck switching asynchronous + // - Make sure to use a context that really shows the panel + + // All that is not necessary for the current use cases so lets + // keep it simple for the time being. + pController->OpenThenToggleDeck(xPanelDescriptor->msDeckId); +} + bool Sidebar::IsPanelVisible( const OUString& rsPanelId, const css::uno::Reference<frame::XFrame>& rxFrame) |