Imported icons for modeboxes and painted window for active icon.

This commit is contained in:
Legaeli 2025-11-10 20:53:06 +01:00
parent 9f1999d7b2
commit e18377af9f
8 changed files with 369 additions and 16 deletions

View File

@ -5,6 +5,7 @@
#include <corecrt_math_defines.h>
#include "JuceLibraryCode/BinaryData.h"
#include "PluginEditor.h"
namespace AXIOM {
class DesignSystem : public juce::LookAndFeel_V4 {
@ -679,6 +680,185 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 {
std::unique_ptr<juce::XmlElement> activeSvg;
};
class lowBandButtonLookAndFeel : public juce::LookAndFeel_V4 {
public:
lowBandButtonLookAndFeel()
{
lowBypassIcon = juce::XmlDocument::parse(BinaryData::bypass_icon_svg);
lowCutIcon = juce::XmlDocument::parse(BinaryData::low_cut_icon_svg);
lowBellIcon = juce::XmlDocument::parse(BinaryData::bell_icon_svg);
lowShelfIcon = juce::XmlDocument::parse(BinaryData::low_shelf_icon_svg);
}
void drawToggleButton(juce::Graphics& g, juce::ToggleButton& button,
bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) override
{
bool isHovered = button.isMouseOverOrDragging();
bool isToggled = button.getToggleState();
bool isEnabled = button.isEnabled();
auto bounds = button.getLocalBounds().toFloat();
auto iconSize = juce::jmin(bounds.getWidth(), bounds.getHeight()) * 0.5f;
auto hoverFactor = isHovered ? 1.05f : 1.0f;
auto iconBounds = juce::Rectangle<float>(iconSize * hoverFactor, iconSize * hoverFactor)
.withCentre(bounds.getCentre());
float bypassOpacity = 1.0f;
if (lowBypassIcon != nullptr && lowCutIcon != nullptr && lowBellIcon != nullptr && lowShelfIcon != nullptr) {
// WICHTIG: Erstelle für jeden Frame ein NEUES Drawable!
auto bypassIcon = juce::Drawable::createFromSVG(*lowBypassIcon);
auto cutIcon = juce::Drawable::createFromSVG(*lowCutIcon);
auto bellIcon = juce::Drawable::createFromSVG(*lowBellIcon);
auto shelfIcon = juce::Drawable::createFromSVG(*lowShelfIcon);
if (bypassIcon != nullptr && cutIcon != nullptr && bellIcon != nullptr && shelfIcon != nullptr)
{
juce::Colour colour;
if (!isEnabled) {
colour = isToggled ? Colours::ACCENTWEAKCOLOUR : Colours::SURFACEBYPASS;
}
else if (isHovered) {
colour = isToggled ? Colours::ACCENTHOVER : Colours::SURFACEHOVER;
} else {
colour = isToggled
? Colours::ACCENTCOLOUR
: Colours::SURFACECOLOUR;
}
// Icon zeichnen
if (button.getName() == "LowBypass") {
bypassIcon->replaceColour(juce::Colours::black, colour);
bypassIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
else if (button.getName() == "LowCut") {
cutIcon->replaceColour(juce::Colours::black, colour);
cutIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
else if (button.getName() == "LowBell") {
bellIcon->replaceColour(juce::Colours::black, colour);
bellIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
else if (button.getName() == "LowShelf") {
shelfIcon->replaceColour(juce::Colours::black, colour);
shelfIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
}
}
}
private:
std::unique_ptr<juce::XmlElement> lowBypassIcon;
std::unique_ptr<juce::XmlElement> lowCutIcon;
std::unique_ptr<juce::XmlElement> lowBellIcon;
std::unique_ptr<juce::XmlElement> lowShelfIcon;
};
class highBandButtonLookAndFeel : public juce::LookAndFeel_V4 {
public:
highBandButtonLookAndFeel()
{
highBypassIcon = juce::XmlDocument::parse(BinaryData::bypass_icon_svg);
highCutIcon = juce::XmlDocument::parse(BinaryData::high_cut_icon_svg);
highBellIcon = juce::XmlDocument::parse(BinaryData::bell_icon_svg);
highShelfIcon = juce::XmlDocument::parse(BinaryData::high_shelf_icon_svg);
}
void drawToggleButton(juce::Graphics& g, juce::ToggleButton& button,
bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) override
{
bool isHovered = button.isMouseOverOrDragging();
bool isToggled = button.getToggleState();
bool isEnabled = button.isEnabled();
auto bounds = button.getLocalBounds().toFloat();
auto iconSize = juce::jmin(bounds.getWidth(), bounds.getHeight()) * 0.5f;
auto hoverFactor = isHovered ? 1.05f : 1.0f;
auto iconBounds = juce::Rectangle<float>(iconSize * hoverFactor, iconSize * hoverFactor)
.withCentre(bounds.getCentre());
float bypassOpacity = 1.0f;
if (highBypassIcon != nullptr && highCutIcon != nullptr && highBellIcon != nullptr && highShelfIcon != nullptr) {
// WICHTIG: Erstelle für jeden Frame ein NEUES Drawable!
auto bypassIcon = juce::Drawable::createFromSVG(*highBypassIcon);
auto cutIcon = juce::Drawable::createFromSVG(*highCutIcon);
auto bellIcon = juce::Drawable::createFromSVG(*highBellIcon);
auto shelfIcon = juce::Drawable::createFromSVG(*highShelfIcon);
if (bypassIcon != nullptr && cutIcon != nullptr && bellIcon != nullptr && shelfIcon != nullptr)
{
juce::Colour colour;
if (!isEnabled) {
colour = isToggled ? Colours::ACCENTWEAKCOLOUR : Colours::SURFACEBYPASS;
}
else if (isHovered) {
colour = isToggled ? Colours::ACCENTHOVER : Colours::SURFACEHOVER;
} else {
colour = isToggled
? Colours::ACCENTCOLOUR
: Colours::SURFACECOLOUR;
}
// Icon zeichnen
if (button.getName() == "HighBypass") {
bypassIcon->replaceColour(juce::Colours::black, colour);
bypassIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
else if (button.getName() == "HighCut") {
cutIcon->replaceColour(juce::Colours::black, colour);
cutIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
else if (button.getName() == "HighBell") {
bellIcon->replaceColour(juce::Colours::black, colour);
bellIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
else if (button.getName() == "HighShelf") {
shelfIcon->replaceColour(juce::Colours::black, colour);
shelfIcon->drawWithin(g, iconBounds,
juce::RectanglePlacement::centred, bypassOpacity);
}
}
}
}
private:
std::unique_ptr<juce::XmlElement> highBypassIcon;
std::unique_ptr<juce::XmlElement> highCutIcon;
std::unique_ptr<juce::XmlElement> highBellIcon;
std::unique_ptr<juce::XmlElement> highShelfIcon;
};
struct ButtonStyles {
};

View File

@ -164,6 +164,11 @@
<None Include="..\..\Resources\Fonts\Orbitron-Bold.ttf"/>
<None Include="..\..\Resources\Fonts\Orbitron-Regular.ttf"/>
<None Include="..\..\Resources\Fonts\Roboto-Regular.ttf"/>
<None Include="..\..\Resources\Icons\bell_icon.svg"/>
<None Include="..\..\Resources\Icons\high_cut_icon.svg"/>
<None Include="..\..\Resources\Icons\high_shelf_icon.svg"/>
<None Include="..\..\Resources\Icons\low_cut_icon.svg"/>
<None Include="..\..\Resources\Icons\low_shelf_icon.svg"/>
<None Include="..\..\Resources\Icons\preset_menu_icon.svg"/>
<None Include="..\..\Resources\Icons\crystalize_button_active_icon.svg"/>
<None Include="..\..\Resources\Icons\crystalize_button_passive_icon.svg"/>

View File

@ -74,6 +74,21 @@
<None Include="..\..\Resources\Fonts\Roboto-Regular.ttf">
<Filter>CrystalizerEQ\Resources\Fonts</Filter>
</None>
<None Include="..\..\Resources\Icons\bell_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>
<None Include="..\..\Resources\Icons\high_cut_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>
<None Include="..\..\Resources\Icons\high_shelf_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>
<None Include="..\..\Resources\Icons\low_cut_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>
<None Include="..\..\Resources\Icons\low_shelf_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>
<None Include="..\..\Resources\Icons\preset_menu_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>

View File

@ -21,6 +21,15 @@
file="Resources/Fonts/Roboto-Regular.ttf"/>
</GROUP>
<GROUP id="{3DCFA257-AECE-2625-016F-D02D71FFA24B}" name="Icons">
<FILE id="waE621" name="bell_icon.svg" compile="0" resource="1" file="Resources/Icons/bell_icon.svg"/>
<FILE id="KOfMYl" name="high_cut_icon.svg" compile="0" resource="1"
file="Resources/Icons/high_cut_icon.svg"/>
<FILE id="zBKRpK" name="high_shelf_icon.svg" compile="0" resource="1"
file="Resources/Icons/high_shelf_icon.svg"/>
<FILE id="RZcm3s" name="low_cut_icon.svg" compile="0" resource="1"
file="Resources/Icons/low_cut_icon.svg"/>
<FILE id="SE1ZID" name="low_shelf_icon.svg" compile="0" resource="1"
file="Resources/Icons/low_shelf_icon.svg"/>
<FILE id="MWCD1t" name="preset_menu_icon.svg" compile="0" resource="1"
file="Resources/Icons/preset_menu_icon.svg"/>
<FILE id="cp2JDP" name="crystalize_button_active_icon.svg" compile="0"

View File

@ -11413,15 +11413,63 @@ static const unsigned char temp_binary_data_6[] =
const char* RobotoRegular_ttf = (const char*) temp_binary_data_6;
//================== preset_menu_icon.svg ==================
//================== bell_icon.svg ==================
static const unsigned char temp_binary_data_7[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 28 12.02\">\n"
" <path fill=\"black\" d=\"M0,8.02h4.82c.75,0,1.45-.34,1.92-.92L11.42,1.24c1.32-1.65,3.84-1.65,5.16,0l4.68,5.86c.47.58,1.17.92,1.92.92h4.82v4h-4.82c-.75,0-1.45-.34-1.92-.92l-5.73-7.16c-.79-.98-2.28-.98-3.07,0l-5.73,7.16c-.47.58-1.17.92-1.92.92H0s0-4,"
"0-4Z\"/>\n"
"</svg>";
const char* bell_icon_svg = (const char*) temp_binary_data_7;
//================== high_cut_icon.svg ==================
static const unsigned char temp_binary_data_8[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n"
" <path fill=\"black\" d=\"M24,23.02V4C24,1.79,22.21,0,20,0H.98C.44,0,0,.44,0,.98v2.03c0,.54.44.98.98.98h17.02c1.2,0,2,.8,2,2v17.02c0,.54.44.98.98.98h2.05c.54,0,.98-.44.98-.98Z\"/>\n"
"</svg>";
const char* high_cut_icon_svg = (const char*) temp_binary_data_8;
//================== high_shelf_icon.svg ==================
static const unsigned char temp_binary_data_9[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 28 12\">\n"
" <path fill=\"black\" d=\"M11.23,6.39l5.62-4.77c1.23-1.04,2.79-1.61,4.4-1.61h6.04c.4,0,.72.32.72.72v2.56c0,.4-.32.72-.72.72h-6.08c-1.62,0-3.18.58-4.41,1.63l-5.56,4.75c-1.23,1.05-2.79,1.63-4.41,1.63H.72c-.4,0-.72-.32-.72-.72v-2.56c0-.4.32-.72.72-.72h"
"6.12c1.61,0,3.17-.57,4.4-1.61Z\"/>\n"
"</svg>";
const char* high_shelf_icon_svg = (const char*) temp_binary_data_9;
//================== low_cut_icon.svg ==================
static const unsigned char temp_binary_data_10[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n"
" <path fill=\"black\" d=\"M0,23.02V4C0,1.79,1.79,0,4,0h19.02c.54,0,.98.44.98.98v2.03c0,.54-.44.98-.98.98H6c-1.2,0-2,.8-2,2v17.02c0,.54-.44.98-.98.98H.98c-.54,0-.98-.44-.98-.98Z\"/>\n"
"</svg>";
const char* low_cut_icon_svg = (const char*) temp_binary_data_10;
//================== low_shelf_icon.svg ==================
static const unsigned char temp_binary_data_11[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 28 12\">\n"
" <path fill=\"black\" d=\"M16.77,6.39L11.15,1.61C9.92.57,8.36,0,6.75,0H.72C.32,0,0,.32,0,.72v2.56c0,.4.32.72.72.72h6.08c1.62,0,3.18.58,4.41,1.63l5.56,4.75c1.23,1.05,2.79,1.63,4.41,1.63h6.11c.4,0,.72-.32.72-.72v-2.56c0-.4-.32-.72-.72-.72h-6.12c-1.61,"
"0-3.17-.57-4.4-1.61Z\"/>\n"
"</svg>";
const char* low_shelf_icon_svg = (const char*) temp_binary_data_11;
//================== preset_menu_icon.svg ==================
static const unsigned char temp_binary_data_12[] =
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\" width=\"60px\" height=\"60px\"><path d=\"M 3 7 A 1.0001 1.0001 0 1 0 3 9 L 27 9 A 1.0001 1.0001 0 1 0 27 7 L 3 7 z M 3 14 A 1.0001 1.0001 0 1 0 3 16 L 27 16 A 1.0001 1.0001 0 1 0 27 14 "
"L 3 14 z M 3 21 A 1.0001 1.0001 0 1 0 3 23 L 27 23 A 1.0001 1.0001 0 1 0 27 21 L 3 21 z\" fill=\"black\"/></svg>";
const char* preset_menu_icon_svg = (const char*) temp_binary_data_7;
const char* preset_menu_icon_svg = (const char*) temp_binary_data_12;
//================== crystalize_button_active_icon.svg ==================
static const unsigned char temp_binary_data_8[] =
static const unsigned char temp_binary_data_13[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 80 32.45\">\n"
" <defs>\n"
@ -11463,10 +11511,10 @@ static const unsigned char temp_binary_data_8[] =
" </g>\n"
"</svg>";
const char* crystalize_button_active_icon_svg = (const char*) temp_binary_data_8;
const char* crystalize_button_active_icon_svg = (const char*) temp_binary_data_13;
//================== crystalize_button_passive_icon.svg ==================
static const unsigned char temp_binary_data_9[] =
static const unsigned char temp_binary_data_14[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 80 32.45\">\n"
" <defs>\n"
@ -11507,17 +11555,17 @@ static const unsigned char temp_binary_data_9[] =
" </g>\n"
"</svg>";
const char* crystalize_button_passive_icon_svg = (const char*) temp_binary_data_9;
const char* crystalize_button_passive_icon_svg = (const char*) temp_binary_data_14;
//================== bypass_icon.svg ==================
static const unsigned char temp_binary_data_10[] =
static const unsigned char temp_binary_data_15[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 22 23\">\n"
" <rect x=\"10\" width=\"2\" height=\"12\"/>\n"
" <path d=\"M13,1.19v1.87c4.1.91,7.17,4.57,7.17,8.94,0,5.06-4.1,9.17-9.17,9.17S1.83,17.06,1.83,12C1.83,7.63,4.9,3.97,9,3.06v-1.87C3.88,2.13,0,6.61,0,12c0,6.08,4.92,11,11,11s11-4.92,11-11c0-5.39-3.88-9.87-9-10.81Z\" fill=\"black\"/>\n"
"</svg>";
const char* bypass_icon_svg = (const char*) temp_binary_data_10;
const char* bypass_icon_svg = (const char*) temp_binary_data_15;
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes);
@ -11538,6 +11586,11 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
case 0xcbceafb3: numBytes = 24668; return OrbitronBold_ttf;
case 0x9c8232dc: numBytes = 24716; return OrbitronRegular_ttf;
case 0x93fe9a1e: numBytes = 146004; return RobotoRegular_ttf;
case 0x1024555a: numBytes = 397; return bell_icon_svg;
case 0x46c5a278: numBytes = 316; return high_cut_icon_svg;
case 0x0133c050: numBytes = 420; return high_shelf_icon_svg;
case 0x31532e06: numBytes = 317; return low_cut_icon_svg;
case 0x7e8ca05e: numBytes = 410; return low_shelf_icon_svg;
case 0x4df4bf1e: numBytes = 350; return preset_menu_icon_svg;
case 0xd842aaab: numBytes = 4212; return crystalize_button_active_icon_svg;
case 0x885a7642: numBytes = 4141; return crystalize_button_passive_icon_svg;
@ -11558,6 +11611,11 @@ const char* namedResourceList[] =
"OrbitronBold_ttf",
"OrbitronRegular_ttf",
"RobotoRegular_ttf",
"bell_icon_svg",
"high_cut_icon_svg",
"high_shelf_icon_svg",
"low_cut_icon_svg",
"low_shelf_icon_svg",
"preset_menu_icon_svg",
"crystalize_button_active_icon_svg",
"crystalize_button_passive_icon_svg",
@ -11573,6 +11631,11 @@ const char* originalFilenames[] =
"Orbitron-Bold.ttf",
"Orbitron-Regular.ttf",
"Roboto-Regular.ttf",
"bell_icon.svg",
"high_cut_icon.svg",
"high_shelf_icon.svg",
"low_cut_icon.svg",
"low_shelf_icon.svg",
"preset_menu_icon.svg",
"crystalize_button_active_icon.svg",
"crystalize_button_passive_icon.svg",

View File

@ -29,6 +29,21 @@ namespace BinaryData
extern const char* RobotoRegular_ttf;
const int RobotoRegular_ttfSize = 146004;
extern const char* bell_icon_svg;
const int bell_icon_svgSize = 397;
extern const char* high_cut_icon_svg;
const int high_cut_icon_svgSize = 316;
extern const char* high_shelf_icon_svg;
const int high_shelf_icon_svgSize = 420;
extern const char* low_cut_icon_svg;
const int low_cut_icon_svgSize = 317;
extern const char* low_shelf_icon_svg;
const int low_shelf_icon_svgSize = 410;
extern const char* preset_menu_icon_svg;
const int preset_menu_icon_svgSize = 350;
@ -42,7 +57,7 @@ namespace BinaryData
const int bypass_icon_svgSize = 406;
// Number of elements in the namedResourceList and originalFileNames arrays.
const int namedResourceListSize = 11;
const int namedResourceListSize = 16;
// Points to the start of a list of resource names.
extern const char* namedResourceList[];

View File

@ -178,6 +178,8 @@ void CrystalizerEQAudioProcessorEditor::setupToggleButtons() {
bypassButtonLookAndFeel = std::make_unique<Components::BypassButtonLookAndFeel>();
svgToggleButtonLookAndFeel = std::make_unique<Components::SvgToggleButtonLookAndFeel>();
presetMenuButtonLookAndFeel = std::make_unique<Components::PresetMenuButtonLookAndFeel>();
lowBandButtonLookAndFeel = std::make_unique<Components::lowBandButtonLookAndFeel>();
highBandButtonLookAndFeel = std::make_unique<Components::highBandButtonLookAndFeel>();
peak1BypassButton.setLookAndFeel(bypassButtonLookAndFeel.get());
peak2BypassButton.setLookAndFeel(bypassButtonLookAndFeel.get());
@ -190,6 +192,17 @@ void CrystalizerEQAudioProcessorEditor::setupToggleButtons() {
lowShelf.setToggleState(true, juce::dontSendNotification);
highShelf.setToggleState(true, juce::dontSendNotification);
lowBypass.setLookAndFeel(lowBandButtonLookAndFeel.get());
lowCut.setLookAndFeel(lowBandButtonLookAndFeel.get());
lowBell.setLookAndFeel(lowBandButtonLookAndFeel.get());
lowShelf.setLookAndFeel(lowBandButtonLookAndFeel.get());
highBypass.setLookAndFeel(highBandButtonLookAndFeel.get());
highCut.setLookAndFeel(highBandButtonLookAndFeel.get());
highBell.setLookAndFeel(highBandButtonLookAndFeel.get());
highShelf.setLookAndFeel(highBandButtonLookAndFeel.get());
for (auto* b : {&peak1BypassButton, &peak2BypassButton, &peak3BypassButton, &crystalizeButton, &masterBypassButton}) {
b->onClick = [this, b]() {
juce::String paramID; // nimm juce::String statt std::string
@ -561,6 +574,9 @@ void CrystalizerEQAudioProcessorEditor::handleLowBandModes() {
param->endChangeGesture();
}
}
else if (lowBandBools[i]) {
lowBandModeButtons[i]->setToggleState(true, juce::dontSendNotification);
}
};
}
}
@ -593,6 +609,9 @@ void CrystalizerEQAudioProcessorEditor::handleHighBandModes() {
param->endChangeGesture();
}
}
else if (highBandBools[i]) {
highBandModeButtons[i]->setToggleState(true, juce::dontSendNotification);
}
};
}
}
@ -743,6 +762,13 @@ CrystalizerEQAudioProcessorEditor::~CrystalizerEQAudioProcessorEditor() {
masterBypassButton.setLookAndFeel(nullptr);
crystalizeButton.setLookAndFeel(nullptr);
presetMenuButton.setLookAndFeel(nullptr);
for (auto* b : lowBandModeButtons) {
b->setLookAndFeel(nullptr);
}
for (auto* b : highBandModeButtons) {
b->setLookAndFeel(nullptr);
}
};
//region paintAnalyzer
@ -763,6 +789,28 @@ void CrystalizerEQAudioProcessorEditor::paintAnalyzer(juce::Graphics &g) {
}
//endregion paintAnalyzer
void CrystalizerEQAudioProcessorEditor::paintModeBoxBorders(juce::Graphics &g) {
for (auto* b : lowBandModeButtons) {
if (b->getToggleState()) {
auto r = getLocalArea(&lowBandModeBox, b->getBounds());
int side = juce::jmin(r.getWidth(), r.getHeight());
r = r.withSizeKeepingCentre(side, side);
auto rf = r.toFloat();
auto rfFilled = rf.toNearestInt().toFloat();
const float stroke = 1.0f;
auto rfStroke = rfFilled.reduced(stroke * 0.5f);
g.setColour(juce::Colours::white.withAlpha(0.3f));
g.fillRoundedRectangle(r.toFloat(), 5);
g.setColour(juce::Colours::white.withAlpha(0.9f));
g.drawRoundedRectangle(rfStroke, 5, stroke);
}
}
}
//==============================================================================
void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g)
{
@ -815,6 +863,8 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g)
g.fillRect(fA);
paintBorderLines(g);
paintModeBoxBorders(g);
g.setColour(Colours::SURFACEBYPASS);
const auto fB = getLocalArea(&footerBar, footerBar.getLocalBounds());
g.fillRect(fB);
@ -883,6 +933,15 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g)
g.setColour(juce::Colours::cyan.withAlpha(0.9f));
g.drawRect(r, 1.0f);
}
for (auto* c : lowBandModeBox.getChildren())
{
auto r = getLocalArea(&lowBandModeBox, c->getBounds()); // lokal in presetArea
g.setColour(juce::Colours::yellow.withAlpha(0.3f));
g.fillRect(r);
g.setColour(juce::Colours::yellow.withAlpha(0.9f));
g.drawRect(r, 1.0f);
}
for (auto* c : lowMidFilterArea.getChildren())
{
auto r = getLocalArea(&lowMidFilterArea, c->getBounds()); // lokal in presetArea
@ -1313,7 +1372,7 @@ void CrystalizerEQAudioProcessorEditor::setupLowBandLayout() {
const auto modeBoxButtonColWidth = modeBoxAreaWidth / 4.0f;
Layout::GridSpec lowBandModeBoxSpec{
/* cols */ { Layout::fr(1), Layout::pxTrack(modeBoxButtonColWidth), Layout::pxTrack(modeBoxButtonColWidth), Layout::fr(1) },
/* cols */ { Layout::fr(1), Layout::fr(1), Layout::fr(1), Layout::fr(1) },
/* rows */ { Layout::fr(1)},
/* colGap */ Spacing::SizeMode::XS,
/* rowGap */ Spacing::SizeMode::XS,
@ -1543,7 +1602,7 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() {
const auto modeBoxButtonColWidth = modeBoxAreaWidth / 4.0f;
Layout::GridSpec highBandModeBoxSpec{
/* cols */ { Layout::fr(1), Layout::pxTrack(modeBoxButtonColWidth), Layout::pxTrack(modeBoxButtonColWidth), Layout::fr(1) },
/* cols */ { Layout::fr(1), Layout::fr(1), Layout::fr(1), Layout::fr(1) },
/* rows */ { Layout::fr(1)},
/* colGap */ Spacing::SizeMode::XS,
/* rowGap */ Spacing::SizeMode::XS,
@ -1551,10 +1610,10 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() {
};
Layout::grid(modeBoxBounds, highBandModeBoxSpec, {
Layout::area(highBypass, 1, 1, 2, 2),
Layout::area(highCut, 1, 2, 2, 3),
Layout::area(highBell, 1, 3, 2, 4),
Layout::area(highShelf, 1, 4, 2, 5)
Layout::area(highBypass, 1, 4, 2, 5),
Layout::area(highCut, 1, 3, 2, 4),
Layout::area(highBell, 1, 2, 2, 3),
Layout::area(highShelf, 1, 1, 2, 2)
});
}
//endregion setupHighBandLayout

View File

@ -134,6 +134,9 @@ public:
~CrystalizerEQAudioProcessorEditor() override;
void paintAnalyzer(juce::Graphics &g);
void paintModeBoxBorders(juce::Graphics &g);
void paintBorderLines(juce::Graphics& g);
//===================================================================
@ -264,6 +267,10 @@ private:
std::unique_ptr<DesignSystem::Components::GlobalSliderLookAndFeel> globalLookAndFeel;
std::unique_ptr<Components::BypassButtonLookAndFeel> bypassButtonLookAndFeel;
std::unique_ptr<Components::PresetMenuButtonLookAndFeel> presetMenuButtonLookAndFeel;
std::unique_ptr<Components::lowBandButtonLookAndFeel> lowBandButtonLookAndFeel;
std::unique_ptr<Components::highBandButtonLookAndFeel> highBandButtonLookAndFeel;
std::unique_ptr<Components::SvgToggleButtonLookAndFeel> svgToggleButtonLookAndFeel;