diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-08-26 18:01:09 -0800 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-29 16:38:28 +0200 |
commit | 2c92b886b7538c4786a4d9a33cbcfe694daf1f62 (patch) | |
tree | 618e2aec5e5e37f6798035c10790ec75254ec3dc /include | |
parent | 17d8f6b0d78c11ac40a335917b3576f13d1e1b9d (diff) |
tdf#119461 Fix focus hidden on deck collapse
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/sidebar/FocusManager.hxx | 5 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarController.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/sidebar/TabBar.hxx | 1 |
3 files changed, 8 insertions, 2 deletions
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<void(const Panel&)>& rShowPanelFunctor); + FocusManager(const std::function<void(const Panel&)>& rShowPanelFunctor, + const std::function<bool(const sal_Int32)> &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<VclPtr<Panel> > maPanels; std::vector<VclPtr<Button> > maButtons; const std::function<void(const Panel&)> maShowPanelFunctor; + const std::function<bool(const sal_Int32)> mbIsDeckOpenFunctor; bool mbObservingContentControlFocus; VclPtr<vcl::Window> mpFirstFocusedContentControl; VclPtr<vcl::Window> 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(); |