Why does PopupMenu have a border on Windows?

The L&F drawPopupMenuBackground method draws a border around the popup menu, but only on Windows (and I suppose Linux too):

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

What is the purpose of this border? My guess is that the dropshadow that is applied to the menu cannot be reliably applied on Windows, so the border is a way of ensuring that the menu has sufficient contrast with its background?

I suspect that code is very old indeed, but probably the original reason was that OSX always adds a 1px border around its menus, so this made it look consistent when you run your code on other OSes.

1 Like

Thanks Jules. It sounds like I can safely remove that snippet from my drawPopupMenuBackground override? On Mac the menu is being rendered without a border, but with a dropshadow, and Iā€™d like it to look like that on Windows too.

yeah, you can do whatever you want in your override!

1 Like