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