in ComboBox::paint(), the font used to draw the textWhenNothingSelected is set this way :
g.setFont (label->getFont());
but this will only work fine if the label’s font has not been specified/overridden by the current lookAndFeel. Otherwise that “textWhenNothingSelected” will get a different font than the combobox selected item text.
Not sure when this would be an issue though as the label is a child class of the ComboBox so should inherit any look and feel changes from the parent, right?
If you’ve overriden LookAndFeel::createComboBoxTextBox to return a label with a custom look and feel then I would expect the “textWhenNothingSelected” to follow that look and feel, right?
The label has the right lookAndFeel.
The problem is that the font used to draw the "textWhenNothingSelected " is not set using the lookandfeel method (i.e getLabelFont()).
here is a short code to reproduce (with screenshot below) :
note that the “textWhenNothingSelected” is just a string, drawn independently from the label. Perhaps it would just make more sense to just set the label text this “textWhenNothingSelected” whenever appropriate
This would also take the label’s look and feel into account as this could be different from the combobox (as the label is created by a look and feel method).