From d301f2ce01b9e7d4ad13f3bd187499112e66b17f Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 25 Feb 2024 19:37:58 +0100 Subject: [PATCH] start the info menu --- CMakeLists.txt | 2 ++ .../juce_gui/components/panels/InfoPanel.cpp | 30 ++++++++++++++++++ .../juce_gui/components/panels/InfoPanel.h | 31 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 libs/tote_bag/juce_gui/components/panels/InfoPanel.cpp create mode 100644 libs/tote_bag/juce_gui/components/panels/InfoPanel.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b9cfca92..c90fc7a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,8 +110,10 @@ set(SourceFiles libs/tote_bag/dsp/EnvelopeDetector.cpp libs/tote_bag/dsp/Saturation.cpp + libs/tote_bag/juce_gui/components/panels/InfoPanel.h libs/tote_bag/juce_gui/components/panels/PresetPanel.h libs/tote_bag/juce_gui/components/panels/VerticalMeterPanel.h + libs/tote_bag/juce_gui/components/panels/InfoPanel.cpp libs/tote_bag/juce_gui/components/panels/PresetPanel.cpp libs/tote_bag/juce_gui/components/panels/VerticalMeterPanel.cpp diff --git a/libs/tote_bag/juce_gui/components/panels/InfoPanel.cpp b/libs/tote_bag/juce_gui/components/panels/InfoPanel.cpp new file mode 100644 index 00000000..4b642f44 --- /dev/null +++ b/libs/tote_bag/juce_gui/components/panels/InfoPanel.cpp @@ -0,0 +1,30 @@ +// 2024 Tote Bag Labs + +#include "InfoPanel.h" + +#include "tote_bag/juce_gui/lookandfeel/LookAndFeelConstants.h" + +namespace tote_bag +{ + +InfoPanel::InfoPanel (std::function mouseUpCallback) + : onMouseUp (mouseUpCallback) +{ +} + +InfoPanel::~InfoPanel() +{ +} + +void InfoPanel::paint (juce::Graphics& g) +{ + g.setColour (colours::plainWhite); + g.fillRect (getBounds()); +} + +void InfoPanel::mouseUp (const juce::MouseEvent& e) +{ + onMouseUp(); +} + +} // namespace tote_bag \ No newline at end of file diff --git a/libs/tote_bag/juce_gui/components/panels/InfoPanel.h b/libs/tote_bag/juce_gui/components/panels/InfoPanel.h new file mode 100644 index 00000000..53704813 --- /dev/null +++ b/libs/tote_bag/juce_gui/components/panels/InfoPanel.h @@ -0,0 +1,31 @@ +// 2024 Tote Bag Labs + +#pragma once + +#include "generated/version.h" + +#include + +#include + +namespace tote_bag +{ + +class InfoPanel : public juce::Component +{ +public: + InfoPanel (std::function mouseUpCallback); + + ~InfoPanel() override; + + void paint (juce::Graphics& g) override; + + void mouseUp (const juce::MouseEvent& e) override; + +private: + std::function onMouseUp; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InfoPanel) +}; + +} // namespace tote_bag