Browse Source

Some minor LookAndFeel_V3 tweaks.

tags/2021-05-28
jules 11 years ago
parent
commit
0a8b8c74e6
1 changed files with 13 additions and 4 deletions
  1. +13
    -4
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp

+ 13
- 4
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp View File

@@ -373,20 +373,29 @@ void LookAndFeel_V3::drawLinearSlider (Graphics& g, int x, int y, int width, int
if (style == Slider::LinearBar || style == Slider::LinearBarVertical)
{
const float fx = (float) x, fy = (float) y, fw = (float) width, fh = (float) height;
Path p;
if (style == Slider::LinearBarVertical)
p.addRectangle ((float) x, sliderPos, (float) width, (height - sliderPos));
p.addRectangle (fx, sliderPos, fw, 1.0f + fh - sliderPos);
else
p.addRectangle ((float) x, (float) y, (sliderPos - x), (float) height);
p.addRectangle (fx, fy, sliderPos - fx, fh);
Colour baseColour (slider.findColour (Slider::thumbColourId)
.withMultipliedSaturation (slider.isEnabled() ? 1.0f : 0.5f)
.withMultipliedAlpha (0.8f));
g.setGradientFill (ColourGradient (baseColour.brighter (0.1f), 0.0f, 0.0f,
baseColour.darker (0.1f), 0.0f, (float) height, false));
g.setGradientFill (ColourGradient (baseColour.brighter (0.08f), 0.0f, 0.0f,
baseColour.darker (0.08f), 0.0f, (float) height, false));
g.fillPath (p);
g.setColour (baseColour.darker (0.2f));
if (style == Slider::LinearBarVertical)
g.fillRect (fx, sliderPos, fw, 1.0f);
else
g.fillRect (sliderPos, fy, 1.0f, fh);
}
else
{


Loading…
Cancel
Save