1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-07 04:10:08 +00:00

Added a drawComboBoxTextWhenNothingSelected() method to ComboBox::LookAndFeelMethods and made the drawing code consistent with drawLabel()

This commit is contained in:
ed 2018-07-27 09:18:19 +01:00
parent 33fb0e9d60
commit fcecf67ab3
4 changed files with 20 additions and 10 deletions

View file

@ -369,16 +369,8 @@ void ComboBox::paint (Graphics& g)
label->getRight(), 0, getWidth() - label->getRight(), getHeight(),
*this);
if (textWhenNothingSelected.isNotEmpty()
&& label->getText().isEmpty()
&& ! label->isBeingEdited())
{
g.setColour (findColour (textColourId).withMultipliedAlpha (0.5f));
g.setFont (label->getLookAndFeel().getLabelFont (*label));
g.drawFittedText (textWhenNothingSelected, label->getBounds().reduced (2, 1),
label->getJustificationType(),
jmax (1, (int) (label->getHeight() / label->getFont().getHeight())));
}
if (textWhenNothingSelected.isNotEmpty() && label->getText().isEmpty() && ! label->isBeingEdited())
getLookAndFeel().drawComboBoxTextWhenNothingSelected (g, *this, *label);
}
void ComboBox::resized()