From 183e04cf45fc6d4795472aa1b0bd1a74117b613b Mon Sep 17 00:00:00 2001 From: Jose Diaz Date: Wed, 17 Apr 2024 20:43:10 +0200 Subject: [PATCH] Adjust preset panelwq border thickness to spec --- libs/tote_bag/juce_gui/components/panels/PresetPanel.cpp | 6 ++++-- libs/tote_bag/juce_gui/components/panels/PresetPanel.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/tote_bag/juce_gui/components/panels/PresetPanel.cpp b/libs/tote_bag/juce_gui/components/panels/PresetPanel.cpp index 30799e12..385bbae7 100644 --- a/libs/tote_bag/juce_gui/components/panels/PresetPanel.cpp +++ b/libs/tote_bag/juce_gui/components/panels/PresetPanel.cpp @@ -64,7 +64,7 @@ void PresetPanel::paint (juce::Graphics& g) g.fillAll(); g.setColour (tote_bag::colours::plainBlack); - g.drawRect (getBounds(), detail::kBorderThickness); + g.drawRect (getBounds(), mBorderThickness); } void PresetPanel::timerCallback() @@ -81,7 +81,9 @@ void PresetPanel::resized() { const auto area = getLocalBounds(); - auto presetBounds = area.reduced (detail::kBorderThickness); + mBorderThickness = area.getHeight() * .04f; + + auto presetBounds = area.reduced (mBorderThickness); const auto presetBoundsWidth = presetBounds.getWidth(); const auto presetBoundsHeight = presetBounds.getHeight(); diff --git a/libs/tote_bag/juce_gui/components/panels/PresetPanel.h b/libs/tote_bag/juce_gui/components/panels/PresetPanel.h index 9d302572..b20d8dbb 100644 --- a/libs/tote_bag/juce_gui/components/panels/PresetPanel.h +++ b/libs/tote_bag/juce_gui/components/panels/PresetPanel.h @@ -49,6 +49,7 @@ class PresetPanel : public juce::Component, public juce::Timer void updatePresetDisplay(); juce::Rectangle outerBorder; + int mBorderThickness = 0; juce::DrawableButton mInfoButton; juce::TextButton mSavePresetButton;