1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

PopupMenu: Adjust the bounds of a menu that intersects with safe inset areas

This commit is contained in:
Anthony Nicholls 2025-10-06 15:37:37 +01:00 committed by Anthony Nicholls
parent 88af872d4d
commit 60c34d3ccb

View file

@ -373,13 +373,13 @@ struct MenuWindow final : public Component
}
else
{
const auto shouldDisableAccessibility = [this]
const auto shouldDisableAccessibility = std::invoke ([this]
{
const auto* compToCheck = parent != nullptr ? parent
: options.getTargetComponent();
return compToCheck != nullptr && ! compToCheck->isAccessible();
}();
});
if (shouldDisableAccessibility)
setAccessible (false);
@ -874,7 +874,7 @@ struct MenuWindow final : public Component
auto parentArea = getParentArea (target.getCentre()) / scaleFactor;
if (auto* pc = options.getParentComponent())
target = pc->getLocalArea (nullptr, target).getIntersection (parentArea);
target = pc->getLocalArea (nullptr, target).constrainedWithin (parentArea);
auto maxMenuHeight = parentArea.getHeight() - 24;