From 2bafb503fddb3543a291ee374499bfd51ff8f1de Mon Sep 17 00:00:00 2001 From: Jose Diaz Date: Wed, 17 Apr 2024 20:25:03 +0200 Subject: [PATCH] squash with top row stuff get the sizing right --- src/gui/panels/ValentineCenterPanel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/panels/ValentineCenterPanel.cpp b/src/gui/panels/ValentineCenterPanel.cpp index a16331d8..2a0aaf8a 100644 --- a/src/gui/panels/ValentineCenterPanel.cpp +++ b/src/gui/panels/ValentineCenterPanel.cpp @@ -49,14 +49,18 @@ void CenterPanel::resized() juce::roundToInt (margin * 1.3f)); const auto topRowArea = localBounds.removeFromTop (localBounds.getHeight() * .50f); - const auto topPanelHeight = juce::roundToInt (topRowArea.getHeight() * .88f); - const auto topPanelY = topRowArea.getCentreY() - topPanelHeight / 2; + const auto topRowBorderHeight = juce::roundToInt (topRowArea.getHeight() * .88f); + const auto topRowBorderY = topRowArea.getCentreY() - topRowBorderHeight / 2; - topRowBorder = topRowArea.withY (topPanelY).withHeight (topPanelHeight); + topRowBorder = topRowArea.withY (topRowBorderY).withHeight (topRowBorderHeight); borderLineThickness = topRowBorder.getHeight() * .005f; borderCornerSize = topRowBorder.getHeight() * .060f; - topRow.setBounds (topRowBorder.reduced (juce::roundToInt (margin))); + const auto topPanelHeight = topRowBorderHeight * .725f; + const auto topPanelY = topRowBorder.getCentreY() - topPanelHeight / 2; + topRow.setBounds (topRowBorder.reduced (juce::roundToInt (margin), 0) + .withY (topPanelY) + .withHeight (topPanelHeight)); localBounds.removeFromTop (margin);