Skip to content

Commit

Permalink
clang format ToggleButton
Browse files Browse the repository at this point in the history
  • Loading branch information
luismrguimaraes committed Aug 12, 2024
1 parent 42d37e2 commit e40b12e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/sst/jucegui/components/ToggleButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ void ToggleButton::paint(juce::Graphics &g)
{
bool v = data ? data->getValue() : false;

if (drawMode != DrawMode::GLYPH && drawMode != DrawMode::DUAL_GLYPH && drawMode != DrawMode::FILLED)
if (drawMode != DrawMode::GLYPH && drawMode != DrawMode::DUAL_GLYPH &&
drawMode != DrawMode::FILLED)
{
v = v && (drawMode != DrawMode::LABELED_BY_DATA);

Expand All @@ -48,14 +49,14 @@ void ToggleButton::paint(juce::Graphics &g)
}
}

if (drawMode == DrawMode::FILLED){
if (drawMode == DrawMode::FILLED)
{
if (isHovered)
{
if(v)
if (v)
g.setColour(getColour(Styles::labelcolor_hover));
else
g.setColour(getColour(Styles::background_hover));

}
else
{
Expand All @@ -64,8 +65,8 @@ void ToggleButton::paint(juce::Graphics &g)
else
g.setColour(getColour(Styles::background));
}
auto b = getLocalBounds().reduced(2).toFloat();

auto b = getLocalBounds().reduced(2).toFloat();
g.fillRoundedRectangle(b, 1.f); // corner size should match those in ButtonPainter.h

// Draw outline
Expand Down

0 comments on commit e40b12e

Please sign in to comment.