Hi,
I’m trying to set a custom font for a ComboBox by overriding LookAndFeel_V3::getComboBoxFont()
in a custom look and feel class and then setting the ComboBox to use an instance of that class for it’s look and feel. However, it just uses the default font regardless of the Font returned by getComboBoxFont()
. JUCE v 4.3.1, OS X 10.12.1.
Minimal code:
class BoxLookAndFeel : public LookAndFeel_V3
{
Font getComboBoxFont (ComboBox& box) override
{
return Font ("Comic Sans MS", "Regular", 20.f);
}
};
class MainContentComponent : public Component
{
public:
MainContentComponent()
{
box.setLookAndFeel(&landf);
box.addItemList(StringArray({"Foo", "Bar", "Baz", NULL}), 1);
addAndMakeVisible(box);
setSize (600, 400);
}
void resized() override
{
box.setBounds(50, 50, 100, 50);
}
private:
BoxLookAndFeel landf;
ComboBox box;
};