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 Dec 31, 2023
1 parent be961c8 commit 2ba8816
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 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 Down

0 comments on commit 2ba8816

Please sign in to comment.