diff --git a/src/ui/lookAndFeel/ControllerLookAndFeel.cpp b/src/ui/lookAndFeel/ControllerLookAndFeel.cpp index ca3e7e0c..249ef196 100644 --- a/src/ui/lookAndFeel/ControllerLookAndFeel.cpp +++ b/src/ui/lookAndFeel/ControllerLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" ControllerLookAndFeel::ControllerLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Buttons */ this->setColour(juce::TextButton::ColourIds::buttonColourId, ColorMap::getInstance()->get("ThemeColorB2")); diff --git a/src/ui/lookAndFeel/ControllerLookAndFeel.h b/src/ui/lookAndFeel/ControllerLookAndFeel.h index 1fa21af0..508905e8 100644 --- a/src/ui/lookAndFeel/ControllerLookAndFeel.h +++ b/src/ui/lookAndFeel/ControllerLookAndFeel.h @@ -1,11 +1,13 @@ #pragma once #include +#include "MainLookAndFeel.h" -class ControllerLookAndFeel : public juce::LookAndFeel_V4 { +class ControllerLookAndFeel : public MainLookAndFeel { public: ControllerLookAndFeel(); + private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ControllerLookAndFeel) }; diff --git a/src/ui/lookAndFeel/LookAndFeelFactory.cpp b/src/ui/lookAndFeel/LookAndFeelFactory.cpp index 352ddcbb..609d053a 100644 --- a/src/ui/lookAndFeel/LookAndFeelFactory.cpp +++ b/src/ui/lookAndFeel/LookAndFeelFactory.cpp @@ -8,6 +8,7 @@ #include "ToolsLookAndFeel.h" #include "MessageLookAndFeel.h" #include "MessageViewLookAndFeel.h" +#include "PluginViewLookAndFeel.h" #include "../misc/ColorMap.h" #include @@ -66,6 +67,9 @@ void LookAndFeelFactory::initialise() { /** Message View */ this->messageViewLAF = std::make_unique(); + + /** Plugin View */ + this->pluginViewLAF = std::make_unique(); } void LookAndFeelFactory::setDefaultSansSerifTypeface(juce::Typeface::Ptr typeface) { @@ -105,6 +109,10 @@ juce::LookAndFeel_V4* LookAndFeelFactory::forMessageView() const { return this->messageViewLAF.get(); } +juce::LookAndFeel_V4* LookAndFeelFactory::forPluginView() const { + return this->pluginViewLAF.get(); +} + LookAndFeelFactory* LookAndFeelFactory::getInstance() { return LookAndFeelFactory::instance ? LookAndFeelFactory::instance : (LookAndFeelFactory::instance = new LookAndFeelFactory{}); diff --git a/src/ui/lookAndFeel/LookAndFeelFactory.h b/src/ui/lookAndFeel/LookAndFeelFactory.h index 1d5deb02..139d0f2c 100644 --- a/src/ui/lookAndFeel/LookAndFeelFactory.h +++ b/src/ui/lookAndFeel/LookAndFeelFactory.h @@ -17,6 +17,7 @@ class LookAndFeelFactory final : private juce::DeletedAtShutdown { juce::LookAndFeel_V4* forTools() const; juce::LookAndFeel_V4* forMessage() const; juce::LookAndFeel_V4* forMessageView() const; + juce::LookAndFeel_V4* forPluginView() const; private: std::unique_ptr mainLAF = nullptr; @@ -28,6 +29,7 @@ class LookAndFeelFactory final : private juce::DeletedAtShutdown { std::unique_ptr toolsLAF = nullptr; std::unique_ptr messageLAF = nullptr; std::unique_ptr messageViewLAF = nullptr; + std::unique_ptr pluginViewLAF = nullptr; public: static LookAndFeelFactory* getInstance(); diff --git a/src/ui/lookAndFeel/MainLookAndFeel.cpp b/src/ui/lookAndFeel/MainLookAndFeel.cpp index 53dd7c94..9b0f9d97 100644 --- a/src/ui/lookAndFeel/MainLookAndFeel.cpp +++ b/src/ui/lookAndFeel/MainLookAndFeel.cpp @@ -1,5 +1,6 @@ #include "MainLookAndFeel.h" #include "../misc/ColorMap.h" +#include "../Utils.h" MainLookAndFeel::MainLookAndFeel() : LookAndFeel_V4() { @@ -80,6 +81,8 @@ MainLookAndFeel::MainLookAndFeel() juce::Colour::fromRGBA(0, 0, 0, 0)); this->setColour(juce::TextEditor::ColourIds::shadowColourId + 1, ColorMap::getInstance()->get("ThemeColorB9"));/**< Empty Text */ + this->setColour(juce::CaretComponent::ColourIds::caretColourId, + ColorMap::getInstance()->get("ThemeColorB9")); /** Set Scroll Bar Color */ this->setColour(juce::ScrollBar::ColourIds::backgroundColourId, @@ -195,8 +198,7 @@ void MainLookAndFeel::drawPopupMenuItem(juce::Graphics& g, const juce::Rectangle const bool isHighlighted, const bool isTicked, const bool hasSubMenu, const juce::String& text, const juce::String& shortcutKeyText, - const juce::Drawable* icon, const juce::Colour* const textColourToUse) -{ + const juce::Drawable* icon, const juce::Colour* const textColourToUse) { if (isSeparator) { auto r = area.reduced(5, 0); r.removeFromTop(juce::roundToInt(((float)r.getHeight() * 0.5f) - 0.5f)); @@ -269,3 +271,37 @@ void MainLookAndFeel::drawPopupMenuItem(juce::Graphics& g, const juce::Rectangle } } } + +juce::Font MainLookAndFeel::getTextButtonFont(juce::TextButton& b, int) { + auto screenSize = utils::getScreenSize(&b); + return juce::Font{ screenSize.getHeight() * 0.02f }; +} + +void MainLookAndFeel::drawCallOutBoxBackground( + juce::CallOutBox& box, juce::Graphics& g, const juce::Path& path, juce::Image& cachedImage) { + juce::Colour colorBackground = this->findColour( + juce::ResizableWindow::ColourIds::backgroundColourId); + + if (cachedImage.isNull()) { + cachedImage = { juce::Image::ARGB, box.getWidth(), box.getHeight(), true }; + juce::Graphics g2(cachedImage); + + juce::DropShadow(juce::Colours::black.withAlpha(0.7f), 8, { 0, 2 }).drawForPath(g2, path); + } + + g.setColour(juce::Colours::black); + g.drawImageAt(cachedImage, 0, 0); + + g.setColour(colorBackground); + g.fillPath(path); +}; + +int MainLookAndFeel::getCallOutBoxBorderSize(const juce::CallOutBox& box) { + auto screenSize = utils::getScreenSize(&box); + return screenSize.getHeight() * 0.005; +}; + +float MainLookAndFeel::getCallOutBoxCornerSize(const juce::CallOutBox& box) { + auto screenSize = utils::getScreenSize(&box); + return screenSize.getHeight() * 0.01; +}; diff --git a/src/ui/lookAndFeel/MainLookAndFeel.h b/src/ui/lookAndFeel/MainLookAndFeel.h index 2d6fdc96..6038ecd9 100644 --- a/src/ui/lookAndFeel/MainLookAndFeel.h +++ b/src/ui/lookAndFeel/MainLookAndFeel.h @@ -19,6 +19,13 @@ class MainLookAndFeel : public juce::LookAndFeel_V4 { const juce::String& shortcutKeyText, const juce::Drawable* icon, const juce::Colour* const textColourToUse) override; + juce::Font getTextButtonFont(juce::TextButton& b, int) override; + + void drawCallOutBoxBackground( + juce::CallOutBox&, juce::Graphics&, const juce::Path&, juce::Image&) override; + int getCallOutBoxBorderSize(const juce::CallOutBox&) override; + float getCallOutBoxCornerSize(const juce::CallOutBox&) override; + private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MainLookAndFeel) }; diff --git a/src/ui/lookAndFeel/MainMenuLookAndFeel.cpp b/src/ui/lookAndFeel/MainMenuLookAndFeel.cpp index 5431a3ce..437f24ba 100644 --- a/src/ui/lookAndFeel/MainMenuLookAndFeel.cpp +++ b/src/ui/lookAndFeel/MainMenuLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" MainMenuLookAndFeel::MainMenuLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Buttons */ this->setColour(juce::TextButton::ColourIds::buttonColourId, ColorMap::getInstance()->get("ThemeColorB2")); diff --git a/src/ui/lookAndFeel/MainMenuLookAndFeel.h b/src/ui/lookAndFeel/MainMenuLookAndFeel.h index 7567bc18..2da853df 100644 --- a/src/ui/lookAndFeel/MainMenuLookAndFeel.h +++ b/src/ui/lookAndFeel/MainMenuLookAndFeel.h @@ -1,8 +1,9 @@ #pragma once #include +#include "MainLookAndFeel.h" -class MainMenuLookAndFeel : public juce::LookAndFeel_V4 { +class MainMenuLookAndFeel : public MainLookAndFeel { public: MainMenuLookAndFeel(); diff --git a/src/ui/lookAndFeel/MessageLookAndFeel.cpp b/src/ui/lookAndFeel/MessageLookAndFeel.cpp index fa996297..fdb82f70 100644 --- a/src/ui/lookAndFeel/MessageLookAndFeel.cpp +++ b/src/ui/lookAndFeel/MessageLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" MessageLookAndFeel::MessageLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Background */ this->setColour(juce::ResizableWindow::ColourIds::backgroundColourId, ColorMap::getInstance()->get("ThemeColorB1")); diff --git a/src/ui/lookAndFeel/MessageLookAndFeel.h b/src/ui/lookAndFeel/MessageLookAndFeel.h index 626be273..b60b429f 100644 --- a/src/ui/lookAndFeel/MessageLookAndFeel.h +++ b/src/ui/lookAndFeel/MessageLookAndFeel.h @@ -1,8 +1,9 @@ #pragma once #include +#include "MainLookAndFeel.h" -class MessageLookAndFeel : public juce::LookAndFeel_V4 { +class MessageLookAndFeel : public MainLookAndFeel { public: MessageLookAndFeel(); diff --git a/src/ui/lookAndFeel/MessageViewLookAndFeel.cpp b/src/ui/lookAndFeel/MessageViewLookAndFeel.cpp index 01244b7c..69edb045 100644 --- a/src/ui/lookAndFeel/MessageViewLookAndFeel.cpp +++ b/src/ui/lookAndFeel/MessageViewLookAndFeel.cpp @@ -3,7 +3,7 @@ #include "../Utils.h" MessageViewLookAndFeel::MessageViewLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Background */ this->setColour(juce::ResizableWindow::ColourIds::backgroundColourId, ColorMap::getInstance()->get("ThemeColorB3")); @@ -46,32 +46,3 @@ MessageViewLookAndFeel::MessageViewLookAndFeel() this->setColour(juce::ScrollBar::ColourIds::trackColourId, ColorMap::getInstance()->get("ThemeColorB1")); } - -void MessageViewLookAndFeel::drawCallOutBoxBackground( - juce::CallOutBox& box, juce::Graphics& g, const juce::Path& path, juce::Image& cachedImage) { - juce::Colour colorBackground = this->findColour( - juce::ResizableWindow::ColourIds::backgroundColourId); - - if (cachedImage.isNull()) { - cachedImage = { juce::Image::ARGB, box.getWidth(), box.getHeight(), true }; - juce::Graphics g2(cachedImage); - - juce::DropShadow(juce::Colours::black.withAlpha(0.7f), 8, { 0, 2 }).drawForPath(g2, path); - } - - g.setColour(juce::Colours::black); - g.drawImageAt(cachedImage, 0, 0); - - g.setColour(colorBackground); - g.fillPath(path); -}; - -int MessageViewLookAndFeel::getCallOutBoxBorderSize(const juce::CallOutBox& box) { - auto screenSize = utils::getScreenSize(&box); - return screenSize.getHeight() * 0.005; -}; - -float MessageViewLookAndFeel::getCallOutBoxCornerSize(const juce::CallOutBox& box) { - auto screenSize = utils::getScreenSize(&box); - return screenSize.getHeight() * 0.01; -}; diff --git a/src/ui/lookAndFeel/MessageViewLookAndFeel.h b/src/ui/lookAndFeel/MessageViewLookAndFeel.h index 56b38462..f7dd41bd 100644 --- a/src/ui/lookAndFeel/MessageViewLookAndFeel.h +++ b/src/ui/lookAndFeel/MessageViewLookAndFeel.h @@ -1,16 +1,12 @@ #pragma once #include +#include "MainLookAndFeel.h" -class MessageViewLookAndFeel : public juce::LookAndFeel_V4 { +class MessageViewLookAndFeel : public MainLookAndFeel { public: MessageViewLookAndFeel(); - void drawCallOutBoxBackground( - juce::CallOutBox&, juce::Graphics&, const juce::Path&, juce::Image&) override; - int getCallOutBoxBorderSize(const juce::CallOutBox&) override; - float getCallOutBoxCornerSize(const juce::CallOutBox&) override; - private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MessageViewLookAndFeel) }; diff --git a/src/ui/lookAndFeel/PluginViewLookAndFeel.cpp b/src/ui/lookAndFeel/PluginViewLookAndFeel.cpp new file mode 100644 index 00000000..b9ba50f6 --- /dev/null +++ b/src/ui/lookAndFeel/PluginViewLookAndFeel.cpp @@ -0,0 +1,9 @@ +#include "PluginViewLookAndFeel.h" +#include "../misc/ColorMap.h" + +PluginViewLookAndFeel::PluginViewLookAndFeel() + : MainLookAndFeel() { + /** Background */ + this->setColour(juce::ResizableWindow::ColourIds::backgroundColourId, + ColorMap::getInstance()->get("ThemeColorB1")); +} diff --git a/src/ui/lookAndFeel/PluginViewLookAndFeel.h b/src/ui/lookAndFeel/PluginViewLookAndFeel.h new file mode 100644 index 00000000..4c47588b --- /dev/null +++ b/src/ui/lookAndFeel/PluginViewLookAndFeel.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include "MainLookAndFeel.h" + +class PluginViewLookAndFeel : public MainLookAndFeel { +public: + PluginViewLookAndFeel(); + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginViewLookAndFeel) +}; diff --git a/src/ui/lookAndFeel/SystemStatusLookAndFeel.cpp b/src/ui/lookAndFeel/SystemStatusLookAndFeel.cpp index 2887bd6d..a19c4a9f 100644 --- a/src/ui/lookAndFeel/SystemStatusLookAndFeel.cpp +++ b/src/ui/lookAndFeel/SystemStatusLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" SystemStatusLookAndFeel::SystemStatusLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Background */ this->setColour(juce::ResizableWindow::ColourIds::backgroundColourId, ColorMap::getInstance()->get("ThemeColorB1")); diff --git a/src/ui/lookAndFeel/SystemStatusLookAndFeel.h b/src/ui/lookAndFeel/SystemStatusLookAndFeel.h index a2a43d05..82a4d621 100644 --- a/src/ui/lookAndFeel/SystemStatusLookAndFeel.h +++ b/src/ui/lookAndFeel/SystemStatusLookAndFeel.h @@ -1,8 +1,9 @@ #pragma once #include +#include "MainLookAndFeel.h" -class SystemStatusLookAndFeel : public juce::LookAndFeel_V4 { +class SystemStatusLookAndFeel : public MainLookAndFeel { public: SystemStatusLookAndFeel(); diff --git a/src/ui/lookAndFeel/TimeLookAndFeel.cpp b/src/ui/lookAndFeel/TimeLookAndFeel.cpp index 16266289..91f00007 100644 --- a/src/ui/lookAndFeel/TimeLookAndFeel.cpp +++ b/src/ui/lookAndFeel/TimeLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" TimeLookAndFeel::TimeLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Background */ this->setColour(juce::ResizableWindow::ColourIds::backgroundColourId, ColorMap::getInstance()->get("ThemeColorB1")); diff --git a/src/ui/lookAndFeel/TimeLookAndFeel.h b/src/ui/lookAndFeel/TimeLookAndFeel.h index 2b1c67d3..a7b169bf 100644 --- a/src/ui/lookAndFeel/TimeLookAndFeel.h +++ b/src/ui/lookAndFeel/TimeLookAndFeel.h @@ -1,8 +1,9 @@ #pragma once #include +#include "MainLookAndFeel.h" -class TimeLookAndFeel : public juce::LookAndFeel_V4 { +class TimeLookAndFeel : public MainLookAndFeel { public: TimeLookAndFeel(); diff --git a/src/ui/lookAndFeel/ToolBarLookAndFeel.cpp b/src/ui/lookAndFeel/ToolBarLookAndFeel.cpp index 541811fa..4057e6e9 100644 --- a/src/ui/lookAndFeel/ToolBarLookAndFeel.cpp +++ b/src/ui/lookAndFeel/ToolBarLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" ToolBarLookAndFeel::ToolBarLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Background */ this->setColour(juce::ResizableWindow::ColourIds::backgroundColourId, ColorMap::getInstance()->get("ThemeColorB2")); diff --git a/src/ui/lookAndFeel/ToolBarLookAndFeel.h b/src/ui/lookAndFeel/ToolBarLookAndFeel.h index b184e722..6efe2a68 100644 --- a/src/ui/lookAndFeel/ToolBarLookAndFeel.h +++ b/src/ui/lookAndFeel/ToolBarLookAndFeel.h @@ -1,8 +1,9 @@ #pragma once #include +#include "MainLookAndFeel.h" -class ToolBarLookAndFeel : public juce::LookAndFeel_V4 { +class ToolBarLookAndFeel : public MainLookAndFeel { public: ToolBarLookAndFeel(); diff --git a/src/ui/lookAndFeel/ToolsLookAndFeel.cpp b/src/ui/lookAndFeel/ToolsLookAndFeel.cpp index e30c0722..7a1c036a 100644 --- a/src/ui/lookAndFeel/ToolsLookAndFeel.cpp +++ b/src/ui/lookAndFeel/ToolsLookAndFeel.cpp @@ -2,7 +2,7 @@ #include "../misc/ColorMap.h" ToolsLookAndFeel::ToolsLookAndFeel() - : LookAndFeel_V4() { + : MainLookAndFeel() { /** Buttons */ this->setColour(juce::TextButton::ColourIds::buttonColourId, ColorMap::getInstance()->get("ThemeColorB2")); diff --git a/src/ui/lookAndFeel/ToolsLookAndFeel.h b/src/ui/lookAndFeel/ToolsLookAndFeel.h index 9230f34a..924cb5db 100644 --- a/src/ui/lookAndFeel/ToolsLookAndFeel.h +++ b/src/ui/lookAndFeel/ToolsLookAndFeel.h @@ -1,8 +1,9 @@ #pragma once #include +#include "MainLookAndFeel.h" -class ToolsLookAndFeel : public juce::LookAndFeel_V4 { +class ToolsLookAndFeel : public MainLookAndFeel { public: ToolsLookAndFeel();