Hi, there is a bug in Juc e 7.0.5. When creating a LinearBarVertical or Horizontal, you can not change the background colour. The issue is in drawLinearSlider, where for slider.isBar no background is drawn.
Thomas
Hi, there is a bug in Juc e 7.0.5. When creating a LinearBarVertical or Horizontal, you can not change the background colour. The issue is in drawLinearSlider, where for slider.isBar no background is drawn.
Thomas
Hi @conTimbre, thanks for posting. It’s far from clear but I think this may have been intentional, even if it’s unintuitive. Unfortunately unless I’m mistaken changing this would likely break many others GUI code. Therefore it’s unlikely we’ll change this now. Probably the easiest thing you can do is…
drawLinearSlider() in your derived LookAndFeel classdrawLinearSlider() in your base LookAndFeel classSomething like this should do it…
class MyLookAndFeelClass : public LookAndFeel_V4
{
void drawLinearSlider (Graphics& g, int x, int y, int width, int height,
float sliderPos, float minSliderPos, float maxSliderPos,
const Slider::SliderStyle style, Slider& slider) override
{
if (slider.isBar())
{
g.setColour (slider.findColour (Slider::ColourIds::backgroundColourId));
g.fillRect (x, y, width, height);
}
LookAndFeel_V4::drawLinearSlider (g, x, y, width, height, sliderPos, minSliderPos, maxSliderPos, style, slider);
}
};
Hi Anthony,
thank you for the comment. I forgot to mention that the problem arises in LookAndFeel_V4.
But look into LookAndFeel_V3::drawLinearSlider
It’s working in V3. It’s not working in V4.
Best Thomas