From e8f41c3abd614c827ecd77e2f7d783006b7c08f8 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 6 May 2024 10:49:16 -0400 Subject: [PATCH] Parent the menu properly so HDPI stands a chance of working (#68) * Parent the menu properly so HDPI stands a chance of working * More windows sizing --- src-juce/AWConsolidatedEditor.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src-juce/AWConsolidatedEditor.cpp b/src-juce/AWConsolidatedEditor.cpp index 1a8224c..2a2f2b4 100644 --- a/src-juce/AWConsolidatedEditor.cpp +++ b/src-juce/AWConsolidatedEditor.cpp @@ -154,7 +154,12 @@ void AWLookAndFeel::setLightTheme() juce::Font AWLookAndFeel::getPopupMenuFont() { + // Seems this font has different metrics on windows +#if JUCE_WINDOWS + return juce::Font(jakartaSansMedium).withHeight(19); +#else return juce::Font(jakartaSansMedium).withHeight(16); +#endif } void AWLookAndFeel::drawPopupMenuBackgroundWithOptions(juce::Graphics &g, int width, int height, @@ -1404,7 +1409,9 @@ void AWConsolidatedAudioProcessorEditor::showMenu() p.addSeparator(); p.addSubMenu("Settings", settingsMenu); - p.showMenuAsync(juce::PopupMenu::Options().withMaximumNumColumns(1)); + const auto mousePos = juce::Desktop::getInstance().getMousePosition(); + const auto targetArea = juce::Rectangle{}.withPosition (mousePos); + p.showMenuAsync(juce::PopupMenu::Options().withMaximumNumColumns(1).withTargetComponent(this).withTargetScreenArea(targetArea)); } struct FxFocusTrav : public juce::ComponentTraverser