diff --git a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp index 4cbd7a33..60e924e5 100644 --- a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp +++ b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp @@ -399,6 +399,18 @@ void LookAndFeel::drawPopupMenuItem (juce::Graphics& g, g.drawFittedText (text, r, juce::Justification::left, 1); } +void LookAndFeel::drawToggleButton (juce::Graphics& g, + juce::ToggleButton& button, + bool shouldDrawButtonAsHighlighted, + bool shouldDrawButtonAsDown) +{ + const auto bounds = button.getLocalBounds(); + + auto fillColour = findColour (ColourIds::knobColourId); + g.setColour (fillColour); + g.fillEllipse (bounds.toFloat()); +} + juce::Slider::SliderLayout LookAndFeel::getSliderLayout (juce::Slider& slider) { // 1. compute the actually visible textBox size from the slider textBox size and some additional constraints diff --git a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h index 20ffe6d1..695c4de8 100644 --- a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h +++ b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h @@ -108,6 +108,11 @@ class LookAndFeel : public juce::LookAndFeel_V4, const juce::Drawable*, const juce::Colour*) override; + void drawToggleButton (juce::Graphics& g, + juce::ToggleButton& button, + bool shouldDrawButtonAsHighlighted, + bool shouldDrawButtonAsDown) override; + juce::Slider::SliderLayout getSliderLayout (juce::Slider& slider) override; enum ColourIds { knobColourId = 0x1001800, pointerColourId = 0x1001801 }; diff --git a/src/gui/panels/ValentineCenterPanel.cpp b/src/gui/panels/ValentineCenterPanel.cpp index 39b821b6..0547777c 100644 --- a/src/gui/panels/ValentineCenterPanel.cpp +++ b/src/gui/panels/ValentineCenterPanel.cpp @@ -72,13 +72,18 @@ void CenterPanel::resized() juce::roundToInt (topRowComponents.getWidth() * .65f)); // Get basic width for top row sliders - auto topRowSliderWidth = juce::roundToInt (topRowSliders.getHeight() * .33f); - // Use that width as reference for button width - const auto topRowButtonWidth = juce::roundToInt (topRowSliderWidth * .25f); + auto topRowSliderWidth = juce::roundToInt (topRowSliders.getWidth() * .33f); + // Use slider width as reference for button width + const auto topRowButtonWidth = juce::roundToInt (topRowSliderWidth * .5f); // Adjust button width to make room topRowSliderWidth -= topRowButtonWidth; - const auto crushButtonBounds = topRowSliders.removeFromLeft (topRowButtonWidth); + auto crushButtonBounds = topRowSliders.removeFromLeft (topRowButtonWidth); + auto crushButtonSpacer = juce::roundToInt ( + (crushButtonBounds.getHeight() - crushButtonBounds.getWidth()) * .5f); + crushButtonBounds.removeFromTop (crushButtonSpacer); + crushButtonBounds.removeFromBottom (crushButtonSpacer); + crushEnableButton.setBounds (crushButtonBounds); const auto logoHeight = juce::roundToInt (topRowComponents.getHeight() * .25f);