Skip to content

Commit

Permalink
some clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Dec 30, 2023
1 parent c1f89f1 commit c9c2a9e
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,13 @@ void CenterPanel::resized()
const auto margin = juce::roundToInt (localBounds.getHeight() * .025f);

const auto topRowHeight = localBounds.getHeight() * .55f;
const auto topRowWidth = localBounds.getWidth();

auto topRowBounds = localBounds.removeFromTop (juce::roundToInt (topRowHeight));
topRowBorder = topRowBounds.reduced (margin);
topRowBorder =
localBounds.removeFromTop (juce::roundToInt (topRowHeight)).reduced (margin);

auto topRowComponents = topRowBorder.reduced (margin);
auto topRowSliders = topRowComponents.removeFromLeft (
juce::roundToInt (topRowComponents.getWidth() * .65f));

const auto topRowButtonWidth = juce::roundToInt (topRowSliders.getWidth() * .033f);
const auto adjustedTopRowComponentsWidth =
topRowSliders.getWidth() - (topRowButtonWidth * 2.0f);
Expand All @@ -115,23 +113,23 @@ void CenterPanel::resized()
const auto topRowButtonSpacer =
juce::roundToInt ((topRowSliders.getHeight() - topRowButtonWidth) * .5f);
const auto topRowButtonNudge = topRowButtonWidth / 2.2f;
auto crushEnableButtonBounds =
topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, topRowButtonSpacer);
crushEnableButtonBounds.setX (crushEnableButtonBounds.getX() + topRowButtonNudge);
const auto initialCrushButtonX = topRowSliders.getX();
const auto crushEnableButtonBounds =
topRowSliders.removeFromLeft (topRowButtonWidth)
.reduced (0, topRowButtonSpacer)
.withX (initialCrushButtonX + topRowButtonNudge);

crushEnableButton.setBounds (crushEnableButtonBounds);

crushSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth));

compressSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth));

auto saturateEnableButtonBounds =
topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, topRowButtonSpacer);
saturateEnableButtonBounds.setX (saturateEnableButtonBounds.getX()
+ topRowButtonNudge);
const auto initialSaturateButtonX = topRowSliders.getX();
const auto saturateEnableButtonBounds =
topRowSliders.removeFromLeft (topRowButtonWidth)
.reduced (0, topRowButtonSpacer)
.withX (initialSaturateButtonX + topRowButtonNudge);

saturateEnableButton.setBounds (saturateEnableButtonBounds);

saturateSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth));

const auto logoHeight = juce::roundToInt (topRowComponents.getHeight() * .25f);
Expand Down Expand Up @@ -164,13 +162,12 @@ void CenterPanel::resized()
const auto bottomRowSliderWidth =
juce::roundToInt (adjustedBottomRowComponentsWidth / 6.0f);

const auto borderSpacer = bottomRowSliderWidth;

ratioSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
attackSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
releaseSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));

const auto dividerBounds = bottomRowComponents.removeFromLeft (borderSpacer);
const auto dividerBounds = bottomRowComponents.removeFromLeft (bottomRowSliderWidth);

bottomRowDivider =
juce::Rectangle<int> (juce::roundToInt (dividerBounds.getCentreX()),
dividerBounds.getY(),
Expand All @@ -180,14 +177,14 @@ void CenterPanel::resized()
const auto bottomRowButtonSpacer =
juce::roundToInt ((bottomRowComponents.getHeight() - bottomRowButtonWidth) * .5f);
const auto bottomRowButtonNudge = bottomRowButtonWidth / 1.25f;
auto clipButtonBounds = bottomRowComponents.removeFromLeft (bottomRowButtonWidth)
.reduced (0, bottomRowButtonSpacer);
clipButtonBounds.setX (clipButtonBounds.getX() + bottomRowButtonNudge);
const auto clipButtonInitialX = bottomRowComponents.getX();
const auto clipButtonBounds =
bottomRowComponents.removeFromLeft (bottomRowButtonWidth)
.reduced (0, bottomRowButtonSpacer)
.withX (clipButtonInitialX + bottomRowButtonNudge);

clipEnableButton.setBounds (clipButtonBounds);

outputSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));

mixSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
}
} // namespace tote_bag
Expand Down

0 comments on commit c9c2a9e

Please sign in to comment.