From 55c296d4f7280d2463da6ffd9ef07147d33b878f Mon Sep 17 00:00:00 2001 From: James Ball Date: Sun, 10 Dec 2023 21:38:35 +0000 Subject: [PATCH] Update lookandfeel and revert to old colours --- Source/LookAndFeel.cpp | 10 +++++----- Source/LookAndFeel.h | 8 ++++---- Source/components/EffectsListComponent.cpp | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Source/LookAndFeel.cpp b/Source/LookAndFeel.cpp index 5b63711..944efdd 100644 --- a/Source/LookAndFeel.cpp +++ b/Source/LookAndFeel.cpp @@ -49,8 +49,8 @@ void OscirenderLookAndFeel::drawComboBox(juce::Graphics& g, int width, int heigh g.setColour(box.findColour(juce::ComboBox::backgroundColourId)); g.fillRect(boxBounds.toFloat()); - g.setColour(box.findColour(juce::ComboBox::outlineColourId)); - g.drawRect(boxBounds.toFloat().reduced(0.5f, 0.5f), 1.0f); + g.setColour(box.findColour(juce::ComboBox::outlineColourId).withAlpha(box.isEnabled() ? 1.0f : 0.5f)); + g.drawRect(boxBounds.toFloat(), 1.0f); juce::Rectangle arrowZone{width - 15, 0, 10, height}; juce::Path path; @@ -59,7 +59,7 @@ void OscirenderLookAndFeel::drawComboBox(juce::Graphics& g, int width, int heigh path.lineTo((float)arrowZone.getRight(), (float)arrowZone.getCentreY() - 3.0f); path.closeSubPath(); - g.setColour(box.findColour(juce::ComboBox::arrowColourId)); + g.setColour(box.findColour(juce::ComboBox::arrowColourId).withAlpha(box.isEnabled() ? 1.0f : 0.5f)); g.fillPath(path); } @@ -147,7 +147,7 @@ void OscirenderLookAndFeel::drawLinearSlider(juce::Graphics& g, int x, int y, in auto thumbWidth = getSliderThumbRadius(slider); - g.setColour(slider.findColour(sliderThumbOutlineColourId)); + g.setColour(slider.findColour(sliderThumbOutlineColourId).withAlpha(slider.isEnabled() ? 1.0f : 0.5f)); g.drawEllipse(juce::Rectangle(static_cast(thumbWidth), static_cast(thumbWidth)).withCentre(point), 1.0f); } @@ -196,4 +196,4 @@ juce::CodeEditorComponent::ColourScheme OscirenderLookAndFeel::getDefaultColourS } return cs; -} +} \ No newline at end of file diff --git a/Source/LookAndFeel.h b/Source/LookAndFeel.h index 7d06a8a..f762d38 100644 --- a/Source/LookAndFeel.h +++ b/Source/LookAndFeel.h @@ -11,10 +11,10 @@ enum ColourIds { }; namespace Colours { - const juce::Colour dark{0xff555555}; - const juce::Colour darker{0xff333333}; - const juce::Colour veryDark{0xff000000}; - const juce::Colour grey{0xff666666}; + const juce::Colour dark{0xff424242}; + const juce::Colour darker{0xff212121}; + const juce::Colour veryDark{0xff111111}; + const juce::Colour grey{0xff555555}; const juce::Colour accentColor{0xff00cc00}; } diff --git a/Source/components/EffectsListComponent.cpp b/Source/components/EffectsListComponent.cpp index d00b482..3e99e59 100644 --- a/Source/components/EffectsListComponent.cpp +++ b/Source/components/EffectsListComponent.cpp @@ -41,7 +41,9 @@ EffectsListComponent::EffectsListComponent(DraggableListBox& lb, AudioEffectList addAndMakeVisible(selected); } -EffectsListComponent::~EffectsListComponent() {} +EffectsListComponent::~EffectsListComponent() { + list.setLookAndFeel(nullptr); +} void EffectsListComponent::paint(juce::Graphics& g) { auto bounds = getLocalBounds();