Skip to content

Commit

Permalink
adjust top row panel size
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Apr 14, 2024
1 parent ef81974 commit 5b11dc1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ void CenterPanel::resized()
localBounds.reduce (juce::roundToInt (margin * 1.6f),
juce::roundToInt (margin * 1.3f));

topRowBorder =
localBounds.removeFromTop (juce::roundToInt (localBounds.getHeight() * .50f));
const auto topRowArea = localBounds.removeFromTop (localBounds.getHeight() * .50f);
const auto topPanelHeight = juce::roundToInt (topRowArea.getHeight() * .95f);
const auto topPanelY = topRowArea.getCentreY() - topPanelHeight / 2;

topRowBorder = topRowArea.withY (topPanelY).withHeight (topPanelHeight);

borderLineThickness = topRowBorder.getHeight() * .005f;

Expand Down
8 changes: 7 additions & 1 deletion src/gui/panels/ValentineTopRowPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ void TopRowPanel::resized()
{
auto bounds = getLocalBounds();

auto sliders = bounds.removeFromLeft (juce::roundToInt (bounds.getWidth() * .65f));
const auto slidersAreaHeight = juce::roundToInt (bounds.getHeight() * .95f);
const auto slidersAreaY = bounds.getCentreY() - slidersAreaHeight / 2;

auto sliders = bounds.removeFromLeft (juce::roundToInt (bounds.getWidth() * .65f))
.withY (slidersAreaY)
.withHeight (slidersAreaHeight);

const auto buttonWidth = juce::roundToInt (sliders.getWidth() * .033f);
const auto adjustedComponentWidth = sliders.getWidth() - (buttonWidth * 2.0f);
const auto sliderWidth = juce::roundToInt (adjustedComponentWidth / 3.0f);
Expand Down

0 comments on commit 5b11dc1

Please sign in to comment.