1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a LookAndFeel method to customise the options of a ComboBox's PopupMenu

This commit is contained in:
hogliux 2018-06-26 18:07:31 +01:00
parent fefbbc89b4
commit 64be913fa2
4 changed files with 16 additions and 6 deletions

View file

@ -545,12 +545,10 @@ void ComboBox::showPopup()
menu.addItem (1, noChoicesMessage, false, false);
}
menu.setLookAndFeel (&getLookAndFeel());
menu.showMenuAsync (PopupMenu::Options().withTargetComponent (this)
.withItemThatMustBeVisible (getSelectedId())
.withMinimumWidth (getWidth())
.withMaximumNumColumns (1)
.withStandardItemHeight (label->getHeight()),
auto& lookAndFeel = getLookAndFeel();
menu.setLookAndFeel (&lookAndFeel);
menu.showMenuAsync (lookAndFeel.getOptionsForComboBoxPopupMenu (*this, *label),
ModalCallbackFunction::forComponent (comboBoxPopupMenuFinishedCallback, this));
}