From e19b46d11f9fddf892980d7ba6c107e1a19dd4d1 Mon Sep 17 00:00:00 2001 From: Vincenzo Sicurella Date: Thu, 18 Jul 2024 03:21:13 -0400 Subject: [PATCH] fix order of stile colour gradient helper --- Source/LumatoneEditorLookAndFeel.h | 86 +++++++++++++++--------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/Source/LumatoneEditorLookAndFeel.h b/Source/LumatoneEditorLookAndFeel.h index 0a1417b..1006ecb 100644 --- a/Source/LumatoneEditorLookAndFeel.h +++ b/Source/LumatoneEditorLookAndFeel.h @@ -59,6 +59,49 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4 return 0.00555556f; } +public: + + juce::ColourGradient getColourGradient(LumatoneEditorColourGradients gradientId, const juce::Rectangle& area) const + { + switch (gradientId) + { + default: + break; + + case LumatoneEditorColourGradients::ExpressionSlider: + return juce::ColourGradient::horizontal( + findColour(LumatoneEditorColourIDs::ExprRotaryGradientMin), + findColour(LumatoneEditorColourIDs::ExprRotaryGradientMax), + area); + case LumatoneEditorColourGradients::BrightnessSlider: + return juce::ColourGradient::horizontal( + findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMin), + findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMax), + area); + + case LumatoneEditorColourGradients::HueSlider: + { + juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::HueRotaryGradientMin), area.getTopLeft(), + findColour(LumatoneEditorColourIDs::HueRotaryGradientMax), area.getTopRight(), + false); + g.addColour(0.5f, findColour(LumatoneEditorColourIDs::HueRotaryGradientMid)); + return g; + } + + case LumatoneEditorColourGradients::TemperatureSlider: + { + juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::TempRotaryGradientMin), area.getTopLeft(), + findColour(LumatoneEditorColourIDs::TempRotaryGradientMax), area.getTopRight(), + false); + g.addColour(0.5f, findColour(LumatoneEditorColourIDs::TempRotaryGradientMid)); + return g; + } + } + + return juce::ColourGradient(); + } + + public: //================================================================== // LookAndFeel_V4 Implementation @@ -539,6 +582,7 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4 g.drawFittedText(btn.getButtonText(), btn.getLocalBounds().withLeft(btn.getHeight() * 1.5f), Justification::centredLeft, 1); } + //================================================================== // // SLIDER METHODS @@ -1400,48 +1444,6 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4 setColour(AlertWindow::ColourIds::outlineColourId, findColour(LumatoneEditorColourIDs::MediumBackground)); } -public: - - juce::ColourGradient LumatoneEditorLookAndFeel::getColourGradient(LumatoneEditorColourGradients gradientId, const juce::Rectangle& area) const - { - switch (gradientId) - { - default: - break; - - case LumatoneEditorColourGradients::ExpressionSlider: - return juce::ColourGradient::horizontal( - findColour(LumatoneEditorColourIDs::ExprRotaryGradientMin), - findColour(LumatoneEditorColourIDs::ExprRotaryGradientMax), - area); - case LumatoneEditorColourGradients::BrightnessSlider: - return juce::ColourGradient::horizontal( - findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMin), - findColour(LumatoneEditorColourIDs::BrightnessRotaryGradientMax), - area); - - case LumatoneEditorColourGradients::HueSlider: - { - juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::HueRotaryGradientMin), area.getTopLeft(), - findColour(LumatoneEditorColourIDs::HueRotaryGradientMax), area.getTopRight(), - false); - g.addColour(0.5f, findColour(LumatoneEditorColourIDs::HueRotaryGradientMid)); - return g; - } - - case LumatoneEditorColourGradients::TemperatureSlider: - { - juce::ColourGradient g = juce::ColourGradient(findColour(LumatoneEditorColourIDs::TempRotaryGradientMin), area.getTopLeft(), - findColour(LumatoneEditorColourIDs::TempRotaryGradientMax), area.getTopRight(), - false); - g.addColour(0.5f, findColour(LumatoneEditorColourIDs::TempRotaryGradientMid)); - return g; - } - } - - return juce::ColourGradient(); - } - private: const LumatoneEditorFontLibrary& appFonts;