1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Accessibility: Added InternalAccessibilityEvent::elementMovedOrResized

This commit is contained in:
ed 2021-06-16 17:22:35 +01:00
parent cdf3b619d8
commit d1b669e6ae
4 changed files with 16 additions and 9 deletions

View file

@ -34,6 +34,7 @@ enum class InternalAccessibilityEvent
{ {
elementCreated, elementCreated,
elementDestroyed, elementDestroyed,
elementMovedOrResized,
focusChanged, focusChanged,
windowOpened, windowOpened,
windowClosed windowClosed

View file

@ -1202,6 +1202,10 @@ void Component::sendMovedResizedMessages (bool wasMoved, bool wasResized)
l.componentMovedOrResized (*this, wasMoved, wasResized); l.componentMovedOrResized (*this, wasMoved, wasResized);
}); });
} }
if (wasMoved || wasResized)
if (auto* handler = getAccessibilityHandler())
notifyAccessibilityEventInternal (*handler, InternalAccessibilityEvent::elementMovedOrResized);
} }
void Component::setSize (int w, int h) { setBounds (getX(), getY(), w, h); } void Component::setSize (int w, int h) { setBounds (getX(), getY(), w, h); }

View file

@ -1069,11 +1069,12 @@ void notifyAccessibilityEventInternal (const AccessibilityHandler& handler, Inte
{ {
switch (eventType) switch (eventType)
{ {
case InternalAccessibilityEvent::elementCreated: return NSAccessibilityCreatedNotification; case InternalAccessibilityEvent::elementCreated: return NSAccessibilityCreatedNotification;
case InternalAccessibilityEvent::elementDestroyed: return NSAccessibilityUIElementDestroyedNotification; case InternalAccessibilityEvent::elementDestroyed: return NSAccessibilityUIElementDestroyedNotification;
case InternalAccessibilityEvent::focusChanged: return NSAccessibilityFocusedUIElementChangedNotification; case InternalAccessibilityEvent::elementMovedOrResized: return NSAccessibilityLayoutChangedNotification;
case InternalAccessibilityEvent::windowOpened: return NSAccessibilityWindowCreatedNotification; case InternalAccessibilityEvent::focusChanged: return NSAccessibilityFocusedUIElementChangedNotification;
case InternalAccessibilityEvent::windowClosed: break; case InternalAccessibilityEvent::windowOpened: return NSAccessibilityWindowCreatedNotification;
case InternalAccessibilityEvent::windowClosed: break;
} }
return NSAccessibilityNotificationName{}; return NSAccessibilityNotificationName{};

View file

@ -168,11 +168,12 @@ void notifyAccessibilityEventInternal (const AccessibilityHandler& handler, Inte
{ {
switch (eventType) switch (eventType)
{ {
case InternalAccessibilityEvent::focusChanged: return UIA_AutomationFocusChangedEventId; case InternalAccessibilityEvent::focusChanged: return UIA_AutomationFocusChangedEventId;
case InternalAccessibilityEvent::windowOpened: return UIA_Window_WindowOpenedEventId; case InternalAccessibilityEvent::windowOpened: return UIA_Window_WindowOpenedEventId;
case InternalAccessibilityEvent::windowClosed: return UIA_Window_WindowClosedEventId; case InternalAccessibilityEvent::windowClosed: return UIA_Window_WindowClosedEventId;
case InternalAccessibilityEvent::elementCreated: case InternalAccessibilityEvent::elementCreated:
case InternalAccessibilityEvent::elementDestroyed: break; case InternalAccessibilityEvent::elementDestroyed:
case InternalAccessibilityEvent::elementMovedOrResized: break;
} }
return {}; return {};