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
|
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;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue