mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Accessibility: Make the FocusTraverser navigate onto disabled components
With this change disabled components become discoverable by screen readers, similarly to how OS native user interface components behave by default. The KeyboardFocusTraverser will still skip disabled components so this does not affect keyboard navigation without screen readers.
This commit is contained in:
parent
02e826dddb
commit
8433428036
5 changed files with 104 additions and 21 deletions
|
|
@ -47,7 +47,8 @@ namespace KeyboardFocusTraverserHelpers
|
|||
detail::FocusHelpers::NavigationDirection direction)
|
||||
{
|
||||
if (auto* comp = detail::FocusHelpers::navigateFocus (current, container, direction,
|
||||
&Component::isKeyboardFocusContainer))
|
||||
&Component::isKeyboardFocusContainer,
|
||||
FocusTraverser::SkipDisabledComponents::yes))
|
||||
{
|
||||
if (isKeyboardFocusable (comp, container))
|
||||
return comp;
|
||||
|
|
@ -85,7 +86,8 @@ std::vector<Component*> KeyboardFocusTraverser::getAllComponents (Component* par
|
|||
std::vector<Component*> components;
|
||||
detail::FocusHelpers::findAllComponents (parentComponent,
|
||||
components,
|
||||
&Component::isKeyboardFocusContainer);
|
||||
&Component::isKeyboardFocusContainer,
|
||||
FocusTraverser::SkipDisabledComponents::yes);
|
||||
|
||||
auto removePredicate = [parentComponent] (const Component* comp)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue