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:
parent
33fb0e9d60
commit
fcecf67ab3
4 changed files with 20 additions and 10 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue