Kaydet (Commit) 27ea5f66 authored tarafından Jim Raykowski's avatar Jim Raykowski Kaydeden (comit) Samuel Mehrbrodt

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: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst ab58646b
......@@ -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:
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment