[Libreoffice-commits] core.git: sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 1 09:19:26 UTC 2018


 sfx2/source/sidebar/FocusManager.cxx      |   35 +++++++++++++++++++++++-------
 sfx2/source/sidebar/SidebarController.cxx |    1 
 2 files changed, 28 insertions(+), 8 deletions(-)

New commits:
commit 27ea5f66c788443aef38cfc5378ec6410d722a9f
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Sat Sep 1 01:22:57 2018 -0800
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Nov 1 10:18:54 2018 +0100

    tdf#119631 Keyboard navigation: Skip hidden tabs in sidebar tab bar
    
    Change-Id: I6ac001c27d6947f379c9923ff8518f9983faa356
    Reviewed-on: https://gerrit.libreoffice.org/62716
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index a95b4405ffd0..b55c356364a2 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -453,21 +453,34 @@ void FocusManager::HandleKeyEvent (
                     else if (IsDeckTitleVisible())
                         FocusDeckTitle();
                     else
-                        FocusButton(maButtons.size()-1);
+                    {
+                        // Focus the last button.
+                        sal_Int32 nIndex(maButtons.size()-1);
+                        while(!maButtons[nIndex].get()->IsVisible() && --nIndex > 0);
+                        FocusButton(nIndex);
+                    }
                     break;
 
                 case PC_DeckTitle:
                 case PC_DeckToolBox:
+                {
                     // Focus the last button.
-                    FocusButton(maButtons.size()-1);
+                    sal_Int32 nIndex(maButtons.size()-1);
+                    while(!maButtons[nIndex].get()->IsVisible() && --nIndex > 0);
+                    FocusButton(nIndex);
                     break;
+                }
 
                 case PC_TabBar:
                     // Go to previous tab bar item.
                     if (aLocation.mnIndex == 0)
                         FocusPanel(maPanels.size()-1, true);
                     else
-                        FocusButton((aLocation.mnIndex + maButtons.size() - 1) % maButtons.size());
+                    {
+                        sal_Int32 nIndex((aLocation.mnIndex + maButtons.size() - 1) % maButtons.size());
+                        while(!maButtons[nIndex].get()->IsVisible() && --nIndex > 0);
+                        FocusButton(nIndex);
+                    }
                     break;
 
                 default:
@@ -501,13 +514,19 @@ void FocusManager::HandleKeyEvent (
                 case PC_TabBar:
                     // Go to next tab bar item.
                     if (aLocation.mnIndex < static_cast<sal_Int32>(maButtons.size())-1)
-                        FocusButton(aLocation.mnIndex + 1);
-                    else
                     {
-                        FocusPanel(0, true);
-                        if (IsDeckTitleVisible())
-                            FocusDeckTitle();
+                        sal_Int32 nIndex(aLocation.mnIndex + 1);
+                        while(!maButtons[nIndex].get()->IsVisible() && ++nIndex < static_cast<sal_Int32>(maButtons.size()));
+                        if (nIndex < static_cast<sal_Int32>(maButtons.size()))
+                        {
+                            FocusButton(nIndex);
+                            break;
+                        }
                     }
+                    if (IsDeckTitleVisible())
+                        FocusDeckTitle();
+                    else
+                        FocusPanel(0, true);
                     break;
 
                 default:
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 82f4eceebd28..338fd9d6137d 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1097,6 +1097,7 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu, bool)
                         // Notify the tab bar about the updated set of decks.
                         mpTabBar->SetDecks(aDecks);
                         mpTabBar->HighlightDeck(mpCurrentDeck->GetId());
+                        mpTabBar->UpdateFocusManager(maFocusManager);
                     }
                 mpParentWindow->GrabFocusToDocument();
             }


More information about the Libreoffice-commits mailing list