generated from sudara/pamplejuce
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c25f36
commit 8ac0f34
Showing
5 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,68 @@ | ||
// 2023 Tote Bag Labs | ||
|
||
#include "ValentineCenterPanel.h" | ||
#include "BinaryData.h" | ||
#include "PluginProcessor.h" | ||
|
||
#include "tote_bag/juce_gui/lookandfeel/LookAndFeelConstants.h" | ||
#include "tote_bag/juce_gui/utilities/GraphicsUtilities.h" | ||
|
||
namespace tote_bag | ||
{ | ||
namespace valentine | ||
{ | ||
CenterPanel::CenterPanel (ValentineAudioProcessor& processor) | ||
: borderLineThickness (0.0f) | ||
, borderCornerSize (0.0f) | ||
{ | ||
} | ||
|
||
CenterPanel::~CenterPanel() | ||
{ | ||
} | ||
|
||
void CenterPanel::paint (juce::Graphics&) | ||
void CenterPanel::paint (juce::Graphics& g) | ||
{ | ||
g.setColour (juce::Colours::black); | ||
|
||
g.drawRoundedRectangle (topRowBorder.toFloat(), | ||
borderCornerSize, | ||
borderLineThickness); | ||
|
||
g.drawRoundedRectangle (bottomRowBorder.toFloat(), | ||
borderCornerSize, | ||
borderLineThickness); | ||
|
||
g.fillRect (bottomRowDivider); | ||
} | ||
|
||
void CenterPanel::resized() | ||
{ | ||
auto localBounds = getLocalBounds(); | ||
const auto margin = juce::roundToInt (localBounds.getHeight() * .025f); | ||
|
||
const auto topRowHeight = localBounds.getHeight() * .55f; | ||
const auto topRowWidth = localBounds.getWidth(); | ||
|
||
auto topRowBounds = localBounds.removeFromTop (juce::roundToInt (topRowHeight)); | ||
topRowBorder = topRowBounds.reduced (margin); | ||
|
||
const auto topRowBorderHeight = topRowBorder.getHeight(); | ||
borderLineThickness = topRowBorderHeight * .01f; | ||
borderCornerSize = topRowBorderHeight * .060f; | ||
|
||
localBounds.removeFromTop (margin); | ||
bottomRowBorder = localBounds.reduced (margin); | ||
|
||
const auto bottomRowBorderWidth = bottomRowBorder.getWidth(); | ||
const auto bottomRowBorderY = bottomRowBorder.getY(); | ||
const auto bottomRowBorderHeight = bottomRowBorder.getHeight(); | ||
bottomRowDivider = | ||
juce::Rectangle<int> (juce::roundToInt (bottomRowBorderWidth * .6f), | ||
bottomRowBorderY, | ||
juce::roundToInt (borderLineThickness), | ||
bottomRowBorderHeight) | ||
.reduced (0, bottomRowBorderHeight * .1f); | ||
} | ||
} // namespace tote_bag | ||
} // namespace valentine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters