Issue in tooltip code


#1

Hi Jules,

I’ve found a bug in LookAndFeel::drawTooltip

The code

[code]void LookAndFeel::drawTooltip (Graphics& g, const String& text, int width, int height)
{
g.fillAll (findColour (TooltipWindow::backgroundColourId));

#if ! JUCE_MAC // The mac windows already have a non-optional 1 pix outline, so don’t double it here…
g.setColour (findColour (TooltipWindow::outlineColourId));
g.drawRect (0, 0, width, height, 1);
#endif

const TextLayout tl (LookAndFeelHelpers::layoutTooltipText (text));

g.setColour (findColour (TooltipWindow::textColourId));
tl.draw (g, Rectangle<float> (0.0f, 0.0f, (float) width, (float) height));

}[/code]
do not work correctly regarding the textColourId as the draw code do not use at all the context current color but use the one in the AttributedString

layoutTooltipText should take the color in argument and call s.append with it.

Thanks,


#2

Thanks! Will sort that out.