Browse Source

MacOS: Accessibility: Fix ToggleButton state reporting

The accessibilityValue method of the AccessibilityCheckBox and
AccessibilityRadioButton protocols is required to return a
boolean valued NSNumber.
v7.0.9
attila 2 years ago
parent
commit
8f2a2ddeea
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      modules/juce_gui_basics/native/accessibility/juce_Accessibility_mac.mm

+ 11
- 3
modules/juce_gui_basics/native/accessibility/juce_Accessibility_mac.mm View File

@@ -269,10 +269,18 @@ private:
{
if (auto* handler = getHandler (self))
{
if (handler->getCurrentState().isCheckable())
return juceStringToNS (handler->getCurrentState().isChecked() ? TRANS ("On") : TRANS ("Off"));
if (! handler->getCurrentState().isCheckable())
return getAccessibilityValueFromInterfaces (*handler);
return getAccessibilityValueFromInterfaces (*handler);
const auto checked = handler->getCurrentState().isChecked();
if ( handler->getRole() == AccessibilityRole::toggleButton
|| handler->getRole() == AccessibilityRole::radioButton)
{
return checked ? @YES : @NO;
}
return juceStringToNS (checked ? TRANS ("On") : TRANS ("Off"));
}
return nil;


Loading…
Cancel
Save