From 11e3d1743368bc6a364b77730be983fcf2fbfdff Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 26 Feb 2018 09:48:58 +0000 Subject: [PATCH] Fixed an issue with bar slider text box colours when using the grey colour scheme of LookAndFeel_V4 --- .../lookandfeel/juce_LookAndFeel_V4.cpp | 13 +++++++++++++ .../lookandfeel/juce_LookAndFeel_V4.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp index d957b7621a..e28731b8da 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp @@ -1105,6 +1105,19 @@ void LookAndFeel_V4::drawPointer (Graphics& g, const float x, const float y, con g.fillPath (p); } +Label* LookAndFeel_V4::createSliderTextBox (Slider& slider) +{ + auto* l = LookAndFeel_V2::createSliderTextBox (slider); + + if (getCurrentColourScheme() == LookAndFeel_V4::getGreyColourScheme() && (slider.getSliderStyle() == Slider::LinearBar + || slider.getSliderStyle() == Slider::LinearBarVertical)) + { + l->setColour (Label::textColourId, Colours::black.withAlpha (0.7f)); + } + + return l; +} + //============================================================================== void LookAndFeel_V4::drawTooltip (Graphics& g, const String& text, int width, int height) { diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h index 466555fd97..a6eabe6971 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.h @@ -199,6 +199,8 @@ public: void drawPointer (Graphics&, float x, float y, float diameter, const Colour&, int direction) noexcept; + Label* createSliderTextBox (Slider&) override; + //============================================================================== void drawTooltip (Graphics&, const String& text, int width, int height) override;