File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ class SimpleButton
5252 using Colour = juce::Colour;
5353 using Image = juce::Image;
5454
55+ const Colour& backgroundColour = Settings::Display::backgroundColour;
56+
5557public:
5658 SimpleButton (String _name, String _displayString, String _tooltip = " " )
5759 : juce::Button(_name)
@@ -81,16 +83,24 @@ class SimpleButton
8183 bool isMouseOverButton,
8284 bool isButtonDown) override
8385 {
86+
87+ const float borderThickness = 1 .0f * size;
88+ const float borderRadius = 3 .0f * size;
89+ const auto outerBounds = getLocalBounds ().toFloat ();
90+ const auto innerBounds = outerBounds.reduced (borderThickness);
91+
8492 if (isButtonDown) {
85- g.fillAll (juce::Colours::magenta);
86- return ;
87- }
88- if (isActive) {
89- g.fillAll (juce::Colours::green);
90- return ;
93+ g.setColour (juce::Colours::white);
94+ g.fillRect (innerBounds);
95+ } else if (isActive) {
96+ g.fillAll (juce::Colours::white);
97+ } else {
98+ g.fillAll (backgroundColour);
99+ g.setColour (juce::Colours::white);
100+ g.drawRect (outerBounds, borderThickness);
91101 }
92102
93- g.fillAll (juce::Colours::yellow );
103+ g.fillAll (juce::Colours::red );
94104 }
95105
96106 // ==============================================================================
You can’t perform that action at this time.
0 commit comments