Trying to style the textWhenNothingSelected
, I see its part of the ComboBox::paint
method. Could this be moved to the LookAndFeel for ComboBox? So we don’t have to copy the whole class just to modify that style (it can’t be subclassed due to private members needed in the paint
method)
2 Likes
Seems not intuitive .textWhenNothingSelected opacity always being at half.
I support this!
void ComboBox::paint(Graphics& g)
{
getLookAndFeel().drawComboBox(g, getWidth(), getHeight(), isButtonDown,
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())));
}
}
Just do it…
I did…
I changed the code directly…
From:
g.setColour(findColour(textColourId).withMultipliedAlpha(0.5f));
To:
g.setColour(findColour(textColourId).withMultipliedAlpha(1.0f));