Skip to content

Commit

Permalink
Parent the menu properly so HDPI stands a chance of working (#68)
Browse files Browse the repository at this point in the history
* Parent the menu properly so HDPI stands a chance of working

* More windows sizing
  • Loading branch information
baconpaul authored May 6, 2024
1 parent 078d55f commit e8f41c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src-juce/AWConsolidatedEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<int>{}.withPosition (mousePos);
p.showMenuAsync(juce::PopupMenu::Options().withMaximumNumColumns(1).withTargetComponent(this).withTargetScreenArea(targetArea));
}

struct FxFocusTrav : public juce::ComponentTraverser
Expand Down

0 comments on commit e8f41c3

Please sign in to comment.