From 2c92b886b7538c4786a4d9a33cbcfe694daf1f62 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Sun, 26 Aug 2018 18:01:09 -0800 Subject: tdf#119461 Fix focus hidden on deck collapse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes Space key behavior the same as mouse click. Focus remains on the tab button when the deck collapses. Makes Enter key never collapses the deck but to open if collapsed and always place focus on the first panel title. Change-Id: Id6d7624e88b421dcfc62f3d0e79986f10c76a65d Reviewed-on: https://gerrit.libreoffice.org/59616 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/sfx2/sidebar/FocusManager.hxx | 5 ++++- include/sfx2/sidebar/SidebarController.hxx | 4 +++- include/sfx2/sidebar/TabBar.hxx | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include/sfx2/sidebar') diff --git a/include/sfx2/sidebar/FocusManager.hxx b/include/sfx2/sidebar/FocusManager.hxx index 84464c4b475f..c089419f05c8 100644 --- a/include/sfx2/sidebar/FocusManager.hxx +++ b/include/sfx2/sidebar/FocusManager.hxx @@ -50,7 +50,8 @@ class DeckTitleBar; class FocusManager { public: - FocusManager(const std::function& rShowPanelFunctor); + FocusManager(const std::function& rShowPanelFunctor, + const std::function &rIsDeckOpenFunctor); ~FocusManager(); /** Forget all panels and buttons. Remove all window listeners. @@ -63,6 +64,7 @@ public: */ void GrabFocus(); void GrabFocusPanel(); + void GrabFocusButton(const sal_Int32 nIndex); void SetDeckTitle(DeckTitleBar* pDeckTitleBar); void SetPanels(const SharedPanelContainer& rPanels); @@ -73,6 +75,7 @@ private: std::vector > maPanels; std::vector > maButtons; const std::function maShowPanelFunctor; + const std::function mbIsDeckOpenFunctor; bool mbObservingContentControlFocus; VclPtr mpFirstFocusedContentControl; VclPtr mpLastFocusedWindow; diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index 33cdfc395200..8274605ba03f 100644 --- a/include/sfx2/sidebar/SidebarController.hxx +++ b/include/sfx2/sidebar/SidebarController.hxx @@ -125,7 +125,7 @@ public: /** Show only the tab bar, not the deck. */ - void RequestCloseDeck(); + void RequestCloseDeck(bool bFocusMenuTab = false); /** Open the deck area and restore the parent window to its old width. */ @@ -135,6 +135,8 @@ public: */ bool IsDeckVisible(const OUString& rsDeckId); + bool IsDeckOpen(const sal_Int32 nIndex = -1); + FocusManager& GetFocusManager() { return maFocusManager;} ResourceManager* GetResourceManager() { return mpResourceManager.get();} diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx index e9ce313c6a68..e0f12a5f15ee 100644 --- a/include/sfx2/sidebar/TabBar.hxx +++ b/include/sfx2/sidebar/TabBar.hxx @@ -86,6 +86,7 @@ public: void HighlightDeck (const OUString& rsDeckId); void RemoveDeckHighlight (); OUString const & GetDeckIdForIndex (const sal_Int32 nIndex) const; + sal_Int32 GetDeckIndexForId (const OUString& rsDeckId); void ToggleHideFlag (const sal_Int32 nIndex); void RestoreHideFlags(); -- cgit