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:
parent
88af872d4d
commit
60c34d3ccb
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue