diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-03 11:06:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-03 11:32:02 +0100 |
commit | 905afcee78db68c21b24bddebb0ec082ca938c7d (patch) | |
tree | b2b3b94eec6cc4c01da676019498e974b7ddf395 /include | |
parent | 3e50a7bf0e3437a22b6440d0f36c242e40c451ae (diff) |
OpenThenSwitchToDeck actually *toggles* deck visibility
so rename it to that and add a OpenThenSwitchToDeck that actually
does that, using the Toggle varient as the callback from the
sidebar button which toggles the current deck on/off
which retains the features of
// tdf#67627 Clicking a second time on a Deck icon will close the Deck
// tdf#88241 Summoning an undocked sidebar a second time should close sidebar
but means that calls to OpenThenSwitchToDeck from e.g. slide layout
don't auto close it if that deck is already open
Change-Id: I3e3724626b93447a7ab6bc7032e9c6839dabcf55
(cherry picked from commit b81daea4a78083def286fa2d5360b152b7a703fd)
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/sidebar/Sidebar.hxx | 10 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarController.hxx | 22 |
2 files changed, 21 insertions, 11 deletions
diff --git a/include/sfx2/sidebar/Sidebar.hxx b/include/sfx2/sidebar/Sidebar.hxx index 46620745f63b..edf184d707b7 100644 --- a/include/sfx2/sidebar/Sidebar.hxx +++ b/include/sfx2/sidebar/Sidebar.hxx @@ -41,6 +41,16 @@ public: const OUString& rsPanelId, const css::uno::Reference<css::frame::XFrame>& rxFrame); + /** Switch to the deck that contains the specified panel and toggle + the visibility of the panel (expanded and scrolled into the + visible area when visible) + Note that most of the work is done asynchronously and that + this function probably returns before the requested panel is visible. + */ + static void TogglePanel ( + const OUString& rsPanelId, + const css::uno::Reference<css::frame::XFrame>& rxFrame); + static bool IsPanelVisible( const OUString& rsPanelId, const css::uno::Reference<css::frame::XFrame>& rxFrame); diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index 6c65867b2a76..76342726d299 100644 --- a/include/sfx2/sidebar/SidebarController.hxx +++ b/include/sfx2/sidebar/SidebarController.hxx @@ -124,8 +124,8 @@ public: const static sal_Int32 gnMaximumSidebarWidth = 400; - void OpenThenSwitchToDeck ( - const ::rtl::OUString& rsDeckId); + void OpenThenSwitchToDeck(const OUString& rsDeckId); + void OpenThenToggleDeck(const OUString& rsDeckId); /** Show only the tab bar, not the deck. */ @@ -137,7 +137,7 @@ public: /** Returns true when the given deck is the currently visible deck */ - bool IsDeckVisible (const ::rtl::OUString& rsDeckId); + bool IsDeckVisible(const OUString& rsDeckId); FocusManager& GetFocusManager() { return maFocusManager;} @@ -148,14 +148,14 @@ public: const Context& GetCurrentContext() const { return maCurrentContext;} bool IsDocumentReadOnly (void) const { return mbIsDocumentReadOnly;} - void SwitchToDeck ( const ::rtl::OUString& rsDeckId); + void SwitchToDeck(const OUString& rsDeckId); void SwitchToDefaultDeck(); - void CreateDeck(const ::rtl::OUString& rDeckId); - void CreateDeck(const ::rtl::OUString& rDeckId, const Context& rContext, bool bForceCreate = false); + void CreateDeck(const OUString& rDeckId); + void CreateDeck(const OUString& rDeckId, const Context& rContext, bool bForceCreate = false); ResourceManager::DeckContextDescriptorContainer GetMatchingDecks(); - ResourceManager::PanelContextDescriptorContainer GetMatchingPanels( const ::rtl::OUString& rDeckId); + ResourceManager::PanelContextDescriptorContainer GetMatchingPanels(const OUString& rDeckId); void notifyDeckTitle(const OUString& targetDeckId); @@ -174,7 +174,7 @@ private: css::uno::Reference<css::frame::XController> mxCurrentController; /// Use a combination of SwitchFlag_* as value. sal_Int32 mnRequestedForceFlags; - ::rtl::OUString msCurrentDeckId; + OUString msCurrentDeckId; AsynchronousCall maPropertyChangeForwarder; AsynchronousCall maContextChangeUpdate; AsynchronousCall maAsynchronousDeckSwitch; @@ -216,15 +216,15 @@ private: css::uno::Reference<css::ui::XUIElement> CreateUIElement ( const css::uno::Reference<css::awt::XWindowPeer>& rxWindow, - const ::rtl::OUString& rsImplementationURL, + const OUString& rsImplementationURL, const bool bWantsCanvas, const Context& rContext); void CreatePanels( - const ::rtl::OUString& rDeckId, + const OUString& rDeckId, const Context& rContext); VclPtr<Panel> CreatePanel ( - const ::rtl::OUString& rsPanelId, + const OUString& rsPanelId, vcl::Window* pParentWindow, const bool bIsInitiallyExpanded, const Context& rContext, |