PopupMenu border in the LnF classes?

gui

#1

Hi,
I’ve trouble finding where I can hack the lookandfeel so that I can suppress the border of a PopupMenu’s panel (see screenshot below). Any idea?
All the best


#2

PopupMenu::LookAndFeelMethods::drawPopupMenuBackground() ?


#3

Sadly not, it does not create the border I’d like to suppress:

void LookAndFeel_V3::drawPopupMenuBackground (Graphics& g, int width, int height)
{
    g.fillAll (findColour (PopupMenu::backgroundColourId));
    ignoreUnused (width, height);

   #if ! JUCE_MAC
    g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f));
    g.drawRect (0, 0, width, height);
   #endif
}

#4

If this is mac and the PopupMenu is in a new Window then could this just be the drop shadow OS X creates for each window?


#5

Yeah, hard to tell from the picture, but it sounds like the default OSX window border


#6

Something strange is that a ComboBox’s PopupMenu has no such border but a real shadow…


#7

OK FOUND: the difference with the ComboBox was that I used withParentComponent:

… m.showMenuAsync(PopupMenu::Options().withParentComponent(getParentComponent()) …

Removing it removes the border.