Skip to content

Commit

Permalink
Further finesse center panel button and slider placements
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Jan 1, 2024
1 parent be961c8 commit ed24a54
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ void CenterPanel::resized()
{
auto localBounds = getLocalBounds();
const auto margin = juce::roundToInt (localBounds.getHeight() * .025f);
localBounds.reduce (margin * 2.5f, margin * 2.0f);

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

topRowBorder =
localBounds.removeFromTop (juce::roundToInt (topRowHeight)).reduced (margin);
auto topRowComponents = topRowBorder.reduced (margin);
topRowBorder = localBounds.removeFromTop (juce::roundToInt (topRowHeight));
auto topRowComponents = topRowBorder.reduced (margin * 1.5f);

auto topRowSliders = topRowComponents.removeFromLeft (
juce::roundToInt (topRowComponents.getWidth() * .65f));
Expand All @@ -114,7 +114,7 @@ void CenterPanel::resized()
juce::roundToInt ((topRowSliders.getHeight() - topRowButtonWidth) * .5f);

// See below note about horizontal LabelSlider dimensions and button placement.
const auto topRowButtonNudge = topRowButtonWidth / 2.2f;
const auto topRowButtonNudge = topRowButtonWidth / 1.5f;

const auto initialCrushButtonX = topRowSliders.getX();
const auto crushEnableButtonBounds =
Expand Down Expand Up @@ -162,14 +162,14 @@ void CenterPanel::resized()
borderLineThickness = topRowBorderHeight * .01f;
borderCornerSize = topRowBorderHeight * .060f;

localBounds.removeFromTop (margin);
bottomRowBorder = localBounds.reduced (margin);
localBounds.removeFromTop (margin * 3);
bottomRowBorder = localBounds;

const auto bottomRowBorderWidth = bottomRowBorder.getWidth();
const auto bottomRowBorderY = bottomRowBorder.getY();
const auto bottomRowBorderHeight = bottomRowBorder.getHeight();

auto bottomRowComponents = bottomRowBorder.reduced (margin);
auto bottomRowComponents = bottomRowBorder.reduced (margin * 1.5f);

const auto bottomRowButtonWidth =
juce::roundToInt (bottomRowComponents.getWidth() / 60.0f);
Expand All @@ -192,7 +192,7 @@ void CenterPanel::resized()

const auto bottomRowButtonSpacer =
juce::roundToInt ((bottomRowComponents.getHeight() - bottomRowButtonWidth) * .5f);
const auto bottomRowButtonNudge = bottomRowButtonWidth / 1.25f;
const auto bottomRowButtonNudge = bottomRowButtonWidth / 1.5f;
const auto clipButtonInitialX = bottomRowComponents.getX();
const auto clipButtonBounds =
bottomRowComponents.removeFromLeft (bottomRowButtonWidth)
Expand Down

0 comments on commit ed24a54

Please sign in to comment.