Distinguish between ComboBox or MenuBar in drawPopupMenuItem?

I have overrided drawPopupMenuItem in my LnF to customize the MenuBar. I would like to paint the menu differently in a ComboBox now. Is there a way to do it?

It seems that i could assign another LnF to the ComboBox’s PopupMenu with getRootMenu. But is there another obvjous approach i didn’t get?

A way is to override drawPopupMenuItemWithOptions instead and check for ComboBox inside.

if (dynamic_cast<juce::ComboBox*> (options.getTargetComponent()) != nullptr) {
    DBG ("ComboBox");
}

For future readers: that trick doesn’t work well for sub-menus. :grimacing: Don’t do that!