mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Slider: LookAndFeel outline style
This commit is contained in:
parent
d264d95595
commit
9d909fc3fe
7 changed files with 31 additions and 6 deletions
|
|
@ -465,6 +465,9 @@ void LookAndFeel_V1::drawLinearSlider (Graphics& g,
|
|||
fill, outline);
|
||||
}
|
||||
}
|
||||
|
||||
if (slider.isBar())
|
||||
drawLinearSliderOutline (g, x, y, w, h, style, slider);
|
||||
}
|
||||
|
||||
Button* LookAndFeel_V1::createSliderButton (Slider&, const bool isIncrement)
|
||||
|
|
|
|||
|
|
@ -1373,6 +1373,16 @@ void LookAndFeel_V2::drawLinearSliderBackground (Graphics& g, int x, int y, int
|
|||
g.strokePath (indent, PathStrokeType (0.5f));
|
||||
}
|
||||
|
||||
void LookAndFeel_V2::drawLinearSliderOutline (Graphics& g, int, int, int width, int height,
|
||||
const Slider::SliderStyle, Slider& slider)
|
||||
{
|
||||
if (slider.getTextBoxPosition() == Slider::NoTextBox)
|
||||
{
|
||||
g.setColour (slider.findColour (Slider::textBoxOutlineColourId));
|
||||
g.drawRect (0, 0, width, height, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void LookAndFeel_V2::drawLinearSliderThumb (Graphics& g, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle style, Slider& slider)
|
||||
|
|
@ -1487,6 +1497,8 @@ void LookAndFeel_V2::drawLinearSlider (Graphics& g, int x, int y, int width, int
|
|||
baseColour,
|
||||
slider.isEnabled() ? 0.9f : 0.3f,
|
||||
true, true, true, true);
|
||||
|
||||
drawLinearSliderOutline (g, x, y, width, height, style, slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -248,6 +248,10 @@ public:
|
|||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderOutline (Graphics&, int x, int y, int width, int height,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
|
||||
void drawLinearSliderThumb (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
|
|
|||
|
|
@ -420,6 +420,8 @@ void LookAndFeel_V3::drawLinearSlider (Graphics& g, int x, int y, int width, int
|
|||
g.fillRect (fx, sliderPos, fw, 1.0f);
|
||||
else
|
||||
g.fillRect (sliderPos, fy, 1.0f, fh);
|
||||
|
||||
drawLinearSliderOutline (g, x, y, width, height, style, slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -956,6 +956,8 @@ void LookAndFeel_V4::drawLinearSlider (Graphics& g, int x, int y, int width, int
|
|||
g.setColour (slider.findColour (Slider::trackColourId));
|
||||
g.fillRect (slider.isHorizontal() ? Rectangle<float> (static_cast<float> (x), (float) y + 0.5f, sliderPos - (float) x, (float) height - 1.0f)
|
||||
: Rectangle<float> ((float) x + 0.5f, sliderPos, (float) width - 1.0f, (float) y + ((float) height - sliderPos)));
|
||||
|
||||
drawLinearSliderOutline (g, x, y, width, height, style, slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1038,6 +1040,9 @@ void LookAndFeel_V4::drawLinearSlider (Graphics& g, int x, int y, int width, int
|
|||
trackWidth * 2.0f, pointerColour, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (slider.isBar())
|
||||
drawLinearSliderOutline (g, x, y, width, height, style, slider);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue