|
|
|
@@ -333,7 +333,7 @@ struct MenuWindow : public Component |
|
|
|
float parentScaleFactor = 1.0f)
|
|
|
|
: Component ("menu"),
|
|
|
|
parent (parentWindow),
|
|
|
|
options (opts.withParentComponent (findLookAndFeel (menu, parentWindow)->getParentComponentForMenuOptions (opts))),
|
|
|
|
options (opts.withParentComponent (findNonNullLookAndFeel (menu, parentWindow).getParentComponentForMenuOptions (opts))),
|
|
|
|
managerOfChosenCommand (manager),
|
|
|
|
componentAttachedTo (options.getTargetComponent()),
|
|
|
|
dismissOnMouseUp (shouldDismissOnMouseUp),
|
|
|
|
@@ -1296,13 +1296,16 @@ struct MenuWindow : public Component |
|
|
|
|
|
|
|
LookAndFeel* findLookAndFeel (const PopupMenu& menu, MenuWindow* parentWindow) const
|
|
|
|
{
|
|
|
|
if (parentWindow != nullptr)
|
|
|
|
return &(parentWindow->getLookAndFeel());
|
|
|
|
return parentWindow != nullptr ? &(parentWindow->getLookAndFeel())
|
|
|
|
: menu.lookAndFeel.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (auto* lnf = menu.lookAndFeel.get())
|
|
|
|
return lnf;
|
|
|
|
LookAndFeel& findNonNullLookAndFeel (const PopupMenu& menu, MenuWindow* parentWindow) const
|
|
|
|
{
|
|
|
|
if (auto* result = findLookAndFeel (menu, parentWindow))
|
|
|
|
return *result;
|
|
|
|
|
|
|
|
return &getLookAndFeel();
|
|
|
|
return getLookAndFeel();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|