From 38fd441a95ff432b3acfdf460f3f8dfbec81ae80 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Mon, 3 Sep 2018 11:57:39 +0100 Subject: [PATCH] Fixed a bug setting PopupMenu parents via a LookAndFeel --- modules/juce_gui_basics/menus/juce_PopupMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index c65c17eec9..b43a3790be 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -211,10 +211,10 @@ struct MenuWindow : public Component setLookAndFeel (parent != nullptr ? &(parent->getLookAndFeel()) : menu.lookAndFeel.get()); - auto& lf = getLookAndFeel(); parentComponent = lf.getParentComponentForMenuOptions (options); + const_cast(options) = options.withParentComponent (parentComponent); if (parentComponent == nullptr && parentWindow == nullptr && lf.shouldPopupMenuScaleWithTargetComponent (options)) if (auto* targetComponent = options.getTargetComponent())