Skip to content

Commit

Permalink
Place Valentine logo
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Dec 3, 2023
1 parent 8ac0f34 commit 60f784c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ namespace valentine
CenterPanel::CenterPanel (ValentineAudioProcessor& processor)
: borderLineThickness (0.0f)
, borderCornerSize (0.0f)
, valentineLogo (
juce::Drawable::createFromImageData (BinaryData::logo_218x40_svg,
BinaryData::logo_218x40_svgSize))
{
addAndMakeVisible (valentineLogo.get());
}

CenterPanel::~CenterPanel()
Expand Down Expand Up @@ -47,6 +51,20 @@ void CenterPanel::resized()
auto topRowBounds = localBounds.removeFromTop (juce::roundToInt (topRowHeight));
topRowBorder = topRowBounds.reduced (margin);

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

const auto logoHeight = juce::roundToInt (topRowComponents.getHeight() * .25f);
topRowComponents.removeFromTop (logoHeight * 1.45f);
topRowComponents.removeFromRight (logoHeight * .5f);
const auto valentineLogoBounds = topRowComponents.removeFromTop (logoHeight);

valentineLogo->setTransformToFit (
valentineLogoBounds.toFloat(),
juce::RectanglePlacement (juce::RectanglePlacement::centred
| juce::RectanglePlacement::fillDestination));

const auto topRowBorderHeight = topRowBorder.getHeight();
borderLineThickness = topRowBorderHeight * .01f;
borderCornerSize = topRowBorderHeight * .060f;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/panels/ValentineCenterPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class CenterPanel : public juce::Component
float borderLineThickness;
float borderCornerSize;

std::unique_ptr<juce::Drawable> valentineLogo;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CenterPanel)
};
} // namespace valentine
Expand Down

0 comments on commit 60f784c

Please sign in to comment.