[Mac] [Focus Zone] Restore broken direction = none functionality

In a previous change, I incorrectly refactored some functionality that caused focus zone to respond to arrow keys even when direction was set to none. This change restores direction = none functionality.

Testing:

* Disabled focus zone: tab works normally (as if no focus zone is present), arrow keys beep
* Arrow keys on direction = none zone: tab works like focus zone (move to outside the zone), arrow keys beep
* Arrow keys on direction = horizontal zone: tab works like focus zone (move to outside the zone), vertical arrow keys beep, horizontal arrow keys move in zone
* Arrow keys on direction = vertical zone: tab works like focus zone (move to outside the zone), horizontal arrow keys beep, vertical arrow keys move in zone
* Arrow keys on direction = bidirectional zone: tab works like focus zone (move to outside the zone), arrow keys move in zone
This commit is contained in:
Navneet Kambo 2024-07-26 14:29:30 -07:00
Родитель dedb5ef0c6
Коммит 817dc2ab93
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -573,11 +573,7 @@ static BOOL ShouldSkipFocusZone(NSView *view)
BOOL passthrough = NO;
NSView *viewToFocus = nil;
if ([self disabled] || action == FocusZoneActionNone
|| (focusZoneDirection == FocusZoneDirectionVertical
&& (action == FocusZoneActionRightArrow || action == FocusZoneActionLeftArrow))
|| (focusZoneDirection == FocusZoneDirectionHorizontal
&& (action == FocusZoneActionUpArrow || action == FocusZoneActionDownArrow)))
if ([self disabled] || action == FocusZoneActionNone)
{
passthrough = YES;
}
@ -585,6 +581,14 @@ static BOOL ShouldSkipFocusZone(NSView *view)
{
viewToFocus = [self nextViewToFocusForTab:action];
}
else if ((focusZoneDirection == FocusZoneDirectionVertical
&& (action == FocusZoneActionRightArrow || action == FocusZoneActionLeftArrow))
|| (focusZoneDirection == FocusZoneDirectionHorizontal
&& (action == FocusZoneActionUpArrow || action == FocusZoneActionDownArrow))
|| (focusZoneDirection == FocusZoneDirectionNone))
{
passthrough = YES;
}
else
{
viewToFocus = [self nextViewToFocusWithFallback:action considerCircular:[@"NavigateWrap" isEqual:navigateAtEnd]];