mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-19 01:04:20 +00:00
Accessibility: Disable accessibility for PopupMenu windows on the desktop when their parent window or target component have accessibility disabled
This commit is contained in:
parent
b65dc65bc2
commit
d6fd33b38d
2 changed files with 18 additions and 3 deletions
|
|
@ -2415,10 +2415,16 @@ public:
|
|||
|
||||
By default this is set to true.
|
||||
|
||||
@see getAccessibilityHandler
|
||||
@see isAccessible, getAccessibilityHandler
|
||||
*/
|
||||
void setAccessible (bool shouldBeAccessible);
|
||||
|
||||
/** Returns true if this component and its children are visible to accessibility clients.
|
||||
|
||||
@see setAccessible
|
||||
*/
|
||||
bool isAccessible() const noexcept;
|
||||
|
||||
/** Returns the accessibility handler for this component, or nullptr if this component is not
|
||||
accessible.
|
||||
|
||||
|
|
@ -2570,8 +2576,6 @@ private:
|
|||
bool reallyContainsInternal (Point<float>, bool);
|
||||
Component* getComponentAtInternal (Point<float>);
|
||||
|
||||
bool isAccessible() const noexcept;
|
||||
|
||||
struct ComponentHelpers;
|
||||
friend struct ComponentHelpers;
|
||||
|
||||
|
|
|
|||
|
|
@ -330,6 +330,17 @@ struct MenuWindow : public Component
|
|||
}
|
||||
else
|
||||
{
|
||||
const auto shouldDisableAccessibility = [this]
|
||||
{
|
||||
const auto* compToCheck = parent != nullptr ? parent
|
||||
: options.getTargetComponent();
|
||||
|
||||
return compToCheck != nullptr && ! compToCheck->isAccessible();
|
||||
}();
|
||||
|
||||
if (shouldDisableAccessibility)
|
||||
setAccessible (false);
|
||||
|
||||
addToDesktop (ComponentPeer::windowIsTemporary
|
||||
| ComponentPeer::windowIgnoresKeyPresses
|
||||
| lf.getMenuWindowFlags());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue