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

tdf#120473 Change sidebar panel content tab navigation behavior

Change-Id: Ifa5d52ffed32a4fe0bfe75fb731ee79d0976c0cf
Reviewed-on: https://gerrit.libreoffice.org/61949
Tested-by: Jenkins
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 0dfb0f09
...@@ -75,9 +75,6 @@ private: ...@@ -75,9 +75,6 @@ private:
std::vector<VclPtr<Button> > maButtons; std::vector<VclPtr<Button> > maButtons;
const std::function<void(const Panel&)> maShowPanelFunctor; const std::function<void(const Panel&)> maShowPanelFunctor;
const std::function<bool(const sal_Int32)> mbIsDeckOpenFunctor; const std::function<bool(const sal_Int32)> mbIsDeckOpenFunctor;
bool mbObservingContentControlFocus;
VclPtr<vcl::Window> mpFirstFocusedContentControl;
VclPtr<vcl::Window> mpLastFocusedWindow;
enum PanelComponent enum PanelComponent
{ {
......
...@@ -41,10 +41,7 @@ FocusManager::FocusManager(const std::function<void(const Panel&)>& rShowPanelFu ...@@ -41,10 +41,7 @@ FocusManager::FocusManager(const std::function<void(const Panel&)>& rShowPanelFu
maPanels(), maPanels(),
maButtons(), maButtons(),
maShowPanelFunctor(rShowPanelFunctor), maShowPanelFunctor(rShowPanelFunctor),
mbIsDeckOpenFunctor(rIsDeckOpenFunctor), mbIsDeckOpenFunctor(rIsDeckOpenFunctor)
mbObservingContentControlFocus(false),
mpFirstFocusedContentControl(nullptr),
mpLastFocusedWindow(nullptr)
{ {
} }
...@@ -265,11 +262,7 @@ void FocusManager::FocusPanelContent (const sal_Int32 nPanelIndex) ...@@ -265,11 +262,7 @@ void FocusManager::FocusPanelContent (const sal_Int32 nPanelIndex)
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(maPanels[nPanelIndex]->GetElementWindow()); VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(maPanels[nPanelIndex]->GetElementWindow());
if (pWindow) if (pWindow)
{
mbObservingContentControlFocus = true;
pWindow->GrabFocus(); pWindow->GrabFocus();
mbObservingContentControlFocus = false;
}
} }
void FocusManager::FocusButton (const sal_Int32 nButtonIndex) void FocusManager::FocusButton (const sal_Int32 nButtonIndex)
...@@ -375,7 +368,6 @@ void FocusManager::HandleKeyEvent ( ...@@ -375,7 +368,6 @@ void FocusManager::HandleKeyEvent (
const vcl::Window& rWindow) const vcl::Window& rWindow)
{ {
const FocusLocation aLocation (GetFocusLocation(rWindow)); const FocusLocation aLocation (GetFocusLocation(rWindow));
mpLastFocusedWindow = nullptr;
switch (rKeyCode.GetCode()) switch (rKeyCode.GetCode())
{ {
...@@ -603,20 +595,6 @@ IMPL_LINK(FocusManager, ChildEventListener, VclWindowEvent&, rEvent, void) ...@@ -603,20 +595,6 @@ IMPL_LINK(FocusManager, ChildEventListener, VclWindowEvent&, rEvent, void)
FocusPanel(aLocation.mnIndex, true); FocusPanel(aLocation.mnIndex, true);
break; break;
case KEY_TAB:
{
WindowType aWindowType = pSource->GetType();
if (mpFirstFocusedContentControl!=nullptr
&& ( mpLastFocusedWindow == mpFirstFocusedContentControl
&& !( WindowType::EDIT == aWindowType || WindowType::SPINFIELD == aWindowType ) ))
{
// Move focus back to panel (or deck)
// title.
FocusPanel(aLocation.mnIndex, true);
}
}
break;
default: default:
break; break;
} }
...@@ -624,16 +602,6 @@ IMPL_LINK(FocusManager, ChildEventListener, VclWindowEvent&, rEvent, void) ...@@ -624,16 +602,6 @@ IMPL_LINK(FocusManager, ChildEventListener, VclWindowEvent&, rEvent, void)
return; return;
} }
case VclEventId::WindowGetFocus:
// Keep track of focused controls in panel content.
// Remember the first focused control. When it is later
// focused again due to pressing the TAB key then the
// focus is moved to the panel or deck title.
mpLastFocusedWindow = pSource;
if (mbObservingContentControlFocus)
mpFirstFocusedContentControl = pSource;
break;
default: default:
break; break;
} }
......
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