GUI colors constants

This commit is contained in:
redtide 2023-04-11 14:23:43 +02:00
parent 5c681d849d
commit a64ec5baea
6 changed files with 134 additions and 65 deletions

View file

@ -31,8 +31,12 @@ set(EDITOR_RESOURCES
Fonts/Roboto-Regular.ttf Fonts/Roboto-Regular.ttf
Themes/Default/theme.xml Themes/Default/theme.xml
Themes/Dark/theme.xml Themes/Dark/theme.xml
PARENT_SCOPE) PARENT_SCOPE
)
set(UI_RESOURCES
resources/Themes/Default/theme.xml
resources/Themes/Dark/theme.xml
)
function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR) function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR)
set(_deps) set(_deps)
foreach(res ${EDITOR_RESOURCES}) foreach(res ${EDITOR_RESOURCES})
@ -51,6 +55,7 @@ endfunction()
set(UI_FILES layout/main.fl layout/about.fl) set(UI_FILES layout/main.fl layout/about.fl)
source_group("Editor UI" FILES ${UI_FILES}) source_group("Editor UI" FILES ${UI_FILES})
source_group("Editor Resources" FILES ${UI_RESOURCES})
# editor # editor
add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
@ -63,6 +68,8 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/EditorController.h src/editor/EditorController.h
src/editor/GUIComponents.h src/editor/GUIComponents.h
src/editor/GUIComponents.cpp src/editor/GUIComponents.cpp
src/editor/GUIDefs.h
src/editor/GUIDefs.cpp
src/editor/GUIHelpers.h src/editor/GUIHelpers.h
src/editor/GUIHelpers.cpp src/editor/GUIHelpers.cpp
src/editor/GUIPiano.h src/editor/GUIPiano.h
@ -83,7 +90,9 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/layout/about.hpp src/editor/layout/about.hpp
src/editor/utility/vstgui_after.h src/editor/utility/vstgui_after.h
src/editor/utility/vstgui_before.h src/editor/utility/vstgui_before.h
${UI_FILES}) ${UI_FILES}
${UI_RESOURCES}
)
add_library(sfizz::editor ALIAS sfizz_editor) add_library(sfizz::editor ALIAS sfizz_editor)
target_include_directories(sfizz_editor PUBLIC "src") target_include_directories(sfizz_editor PUBLIC "src")
target_link_libraries(sfizz_editor PUBLIC sfizz::messaging sfizz::plugins-common) target_link_libraries(sfizz_editor PUBLIC sfizz::messaging sfizz::plugins-common)

View file

@ -6,6 +6,7 @@
#include "DlgAbout.h" #include "DlgAbout.h"
#include "GUIComponents.h" #include "GUIComponents.h"
#include "GUIDefs.h"
#include "GitBuildId.h" #include "GitBuildId.h"
#include "NativeHelpers.h" #include "NativeHelpers.h"
@ -15,23 +16,25 @@
#include <absl/strings/str_cat.h> #include <absl/strings/str_cat.h>
using namespace gui;
SAboutDialog::SAboutDialog(const CRect& bounds) SAboutDialog::SAboutDialog(const CRect& bounds)
: CViewContainer(bounds) : CViewContainer(bounds)
{ {
SharedPointer<CBitmap> logo = owned(new CBitmap("logo_orange.png")); SharedPointer<CBitmap> logo = owned(new CBitmap("logo_orange.png"));
setBackgroundColor(CColor(0x00, 0x00, 0x00, 0xc0)); setBackgroundColor(kColorControlsScroller);
CView* aboutView = nullptr; CView* aboutView = nullptr;
{ {
auto createaboutView = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { auto createaboutView = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
CViewContainer* container = new CViewContainer(bounds); CViewContainer* container = new CViewContainer(bounds);
container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); container->setBackgroundColor(kColorTransparent);
return container; return container;
}; };
auto createLogo = [&logo](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { auto createLogo = [&logo](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
CViewContainer* container = new CViewContainer(bounds); CViewContainer* container = new CViewContainer(bounds);
container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); container->setBackgroundColor(kColorTransparent);
container->setBackground(logo); container->setBackground(logo);
return container; return container;
}; };
@ -40,9 +43,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds); CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize); auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font); lbl->setFont(font);
lbl->setFontColor(CColor(0xff, 0xff, 0xff, 0xff)); lbl->setFontColor(kWhiteCColor);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align); lbl->setHoriAlign(align);
const char* version = SFIZZ_VERSION; const char* version = SFIZZ_VERSION;
@ -62,9 +65,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds); CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize); auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font); lbl->setFont(font);
lbl->setFontColor(CColor(0xff, 0xff, 0xff, 0xff)); lbl->setFontColor(kWhiteCColor);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align); lbl->setHoriAlign(align);
lbl->setText(absl::StrCat( lbl->setText(absl::StrCat(
u8"Maintainers: Paul Ferrand, Jean-Pierre Cimalando\n" u8"Maintainers: Paul Ferrand, Jean-Pierre Cimalando\n"
@ -77,9 +80,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
auto createHoverBox = [](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) { auto createHoverBox = [](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label); CTextLabel* lbl = new CTextLabel(bounds, label);
auto font = makeOwned<CFontDesc>("Roboto", fontsize); auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFontColor(CColor(0xfd, 0x98, 0x00, 0xff)); lbl->setFontColor(kColorOrange);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align); lbl->setHoriAlign(align);
lbl->setFont(font); lbl->setFont(font);
return lbl; return lbl;
@ -89,9 +92,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds); CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize, kBoldFace); auto font = makeOwned<CFontDesc>("Roboto", fontsize, kBoldFace);
lbl->setFont(font); lbl->setFont(font);
lbl->setFontColor(CColor(0xfd, 0x98, 0x00, 0xff)); lbl->setFontColor(kColorOrange);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align); lbl->setHoriAlign(align);
lbl->setText(label); lbl->setText(label);
return lbl; return lbl;
@ -101,9 +104,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds); CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize); auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font); lbl->setFont(font);
lbl->setFontColor(CColor(0xff, 0xff, 0xff, 0xff)); lbl->setFontColor(kWhiteCColor);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align); lbl->setHoriAlign(align);
lbl->setText(label); lbl->setText(label);
return lbl; return lbl;
@ -113,9 +116,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
STextButton* btn = new STextButton(bounds, this, tag, glyph); STextButton* btn = new STextButton(bounds, this, tag, glyph);
btn->setFont(makeOwned<CFontDesc>("Sfizz Misc Icons", fontsize)); btn->setFont(makeOwned<CFontDesc>("Sfizz Misc Icons", fontsize));
btn->setTextColor(kWhiteCColor); btn->setTextColor(kWhiteCColor);
btn->setHighlightColor(CColor(0xfd, 0x98, 0x00, 0xff)); btn->setHighlightColor(kColorOrange);
btn->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); btn->setFrameColor(kColorTransparent);
btn->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00)); btn->setFrameColorHighlighted(kColorTransparent);
btn->setGradient(nullptr); btn->setGradient(nullptr);
btn->setGradientHighlighted(nullptr); btn->setGradientHighlighted(nullptr);
return btn; return btn;

View file

@ -7,6 +7,7 @@
#include "Editor.h" #include "Editor.h"
#include "EditorController.h" #include "EditorController.h"
#include "EditIds.h" #include "EditIds.h"
#include "GUIDefs.h"
#include "GUIComponents.h" #include "GUIComponents.h"
#include "GUIHelpers.h" #include "GUIHelpers.h"
#include "GUIPiano.h" #include "GUIPiano.h"
@ -44,6 +45,7 @@
#include "utility/vstgui_after.h" #include "utility/vstgui_after.h"
using namespace VSTGUI; using namespace VSTGUI;
using namespace gui;
const int Editor::viewWidth { 800 }; const int Editor::viewWidth { 800 };
const int Editor::viewHeight { 475 }; const int Editor::viewHeight { 475 };
@ -366,9 +368,9 @@ void Editor::close()
SLevelMeter* Editor::Impl::createVMeter(const CRect& bounds, int, const char*, CHoriTxtAlign, int) { SLevelMeter* Editor::Impl::createVMeter(const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
SLevelMeter* meter = new SLevelMeter(bounds); SLevelMeter* meter = new SLevelMeter(bounds);
Palette* palette = &theme_->invertedPalette; Palette* palette = &theme_->invertedPalette;
meter->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); meter->setFrameColor(kColorTransparent);
meter->setNormalFillColor(CColor(0x00, 0xaa, 0x11)); meter->setNormalFillColor(kColorMeterNormal);
meter->setDangerFillColor(CColor(0xaa, 0x00, 0x00)); meter->setDangerFillColor(kColorMeterDanger);
meter->setBackColor(palette->knobInactiveTrack); meter->setBackColor(palette->knobInactiveTrack);
return meter; return meter;
}; };
@ -742,7 +744,7 @@ void Editor::Impl::createFrameContents()
auto createLogicalGroup = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { auto createLogicalGroup = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
CViewContainer* container = new CViewContainer(bounds); CViewContainer* container = new CViewContainer(bounds);
container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); container->setBackgroundColor(kColorTransparent);
return container; return container;
}; };
auto createRoundedGroup = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { auto createRoundedGroup = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
@ -783,8 +785,8 @@ void Editor::Impl::createFrameContents()
}; };
auto createLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) { auto createLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label); CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() { OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->text); lbl->setFontColor(palette->text);
}); });
@ -795,8 +797,8 @@ void Editor::Impl::createFrameContents()
}; };
auto createInactiveLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) { auto createInactiveLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label); CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() { OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->inactiveText); lbl->setFontColor(palette->inactiveText);
}); });
@ -816,8 +818,8 @@ void Editor::Impl::createFrameContents()
}; };
auto createValueLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) { auto createValueLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label); CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setBackColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() { OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->text); lbl->setFontColor(palette->text);
}); });
@ -828,7 +830,7 @@ void Editor::Impl::createFrameContents()
}; };
auto createBadge = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) { auto createBadge = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label); CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); lbl->setFrameColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() { OnThemeChanged.push_back([lbl, palette]() {
lbl->setBackColor(palette->valueBackground); lbl->setBackColor(palette->valueBackground);
lbl->setFontColor(palette->valueText); lbl->setFontColor(palette->valueText);
@ -851,9 +853,9 @@ void Editor::Impl::createFrameContents()
button->setInactiveColor(palette->inactiveText); button->setInactiveColor(palette->inactiveText);
button->setHighlightColor(palette->highlightedText); button->setHighlightColor(palette->highlightedText);
}); });
button->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); button->setFrameColor(kColorTransparent);
button->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00)); button->setFrameColorHighlighted(kColorTransparent);
SharedPointer<CGradient> gradient = owned(CGradient::create(0.0, 1.0, CColor(0x00, 0x00, 0x00, 0x00), CColor(0x00, 0x00, 0x00, 0x00))); SharedPointer<CGradient> gradient = owned(CGradient::create(0.0, 1.0, kColorTransparent, kColorTransparent));
button->setGradient(gradient); button->setGradient(gradient);
button->setGradientHighlighted(gradient); button->setGradientHighlighted(gradient);
return button; return button;
@ -871,8 +873,8 @@ void Editor::Impl::createFrameContents()
button->setGradient(gradient); button->setGradient(gradient);
button->setGradientHighlighted(gradient); button->setGradientHighlighted(gradient);
}); });
button->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); button->setFrameColor(kColorTransparent);
button->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00)); button->setFrameColorHighlighted(kColorTransparent);
return button; return button;
}; };
auto createValueMenu = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign align, int fontsize) { auto createValueMenu = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign align, int fontsize) {
@ -884,7 +886,7 @@ void Editor::Impl::createFrameContents()
vm->setFontColor(palette->valueText); vm->setFontColor(palette->valueText);
vm->setBackColor(palette->valueBackground); vm->setBackColor(palette->valueBackground);
}); });
vm->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); vm->setFrameColor(kColorTransparent);
vm->setStyle(CParamDisplay::kRoundRectStyle); vm->setStyle(CParamDisplay::kRoundRectStyle);
vm->setRoundRectRadius(5.0); vm->setRoundRectRadius(5.0);
return vm; return vm;
@ -898,7 +900,7 @@ void Editor::Impl::createFrameContents()
cb->setFontColor(palette->valueText); cb->setFontColor(palette->valueText);
cb->setBackColor(palette->valueBackground); cb->setBackColor(palette->valueBackground);
}); });
cb->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); cb->setFrameColor(kColorTransparent);
cb->setStyle(CParamDisplay::kRoundRectStyle); cb->setStyle(CParamDisplay::kRoundRectStyle);
cb->setRoundRectRadius(5.0); cb->setRoundRectRadius(5.0);
return cb; return cb;
@ -923,8 +925,8 @@ void Editor::Impl::createFrameContents()
btn->setTextColor(palette->icon); btn->setTextColor(palette->icon);
btn->setHighlightColor(palette->iconHighlight); btn->setHighlightColor(palette->iconHighlight);
}); });
btn->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); btn->setFrameColor(kColorTransparent);
btn->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00)); btn->setFrameColorHighlighted(kColorTransparent);
btn->setGradient(nullptr); btn->setGradient(nullptr);
btn->setGradientHighlighted(nullptr); btn->setGradientHighlighted(nullptr);
return btn; return btn;
@ -990,8 +992,8 @@ void Editor::Impl::createFrameContents()
menu->setFontColor(palette->icon); menu->setFontColor(palette->icon);
menu->setHoverColor(palette->iconHighlight); menu->setHoverColor(palette->iconHighlight);
}); });
menu->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); menu->setFrameColor(kColorTransparent);
menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); menu->setBackColor(kColorTransparent);
return menu; return menu;
}; };
auto createChevronValueDropDown = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) { auto createChevronValueDropDown = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) {
@ -1005,8 +1007,8 @@ void Editor::Impl::createFrameContents()
menu->setFontColor(palette->icon); menu->setFontColor(palette->icon);
menu->setHoverColor(palette->iconHighlight); menu->setHoverColor(palette->iconHighlight);
}); });
menu->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); menu->setFrameColor(kColorTransparent);
menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); menu->setBackColor(kColorTransparent);
return menu; return menu;
}; };
auto createKnob48 = [this, &knob48](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) { auto createKnob48 = [this, &knob48](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) {
@ -1081,7 +1083,7 @@ void Editor::Impl::createFrameContents()
auto font = makeOwned<CFontDesc>("Roboto", fontsize); auto font = makeOwned<CFontDesc>("Roboto", fontsize);
edit->setFont(font); edit->setFont(font);
edit->setHoriAlign(align); edit->setHoriAlign(align);
edit->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); edit->setFrameColor(kColorTransparent);
edit->setStyle(CParamDisplay::kRoundRectStyle); edit->setStyle(CParamDisplay::kRoundRectStyle);
edit->setRoundRectRadius(5.0); edit->setRoundRectRadius(5.0);
OnThemeChanged.push_back([edit, palette]() { OnThemeChanged.push_back([edit, palette]() {
@ -1112,7 +1114,7 @@ void Editor::Impl::createFrameContents()
CViewContainer* box = new CViewContainer(bounds); CViewContainer* box = new CViewContainer(bounds);
mainView->addView(box); mainView->addView(box);
box->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0xc0)); box->setBackgroundColor(kColorTransparentDark);
CRect textSize = CRect(0, 0, 400, 80).centerInside(bounds); CRect textSize = CRect(0, 0, 400, 80).centerInside(bounds);
CMultiLineTextLabel* textLabel = new CMultiLineTextLabel(textSize); CMultiLineTextLabel* textLabel = new CMultiLineTextLabel(textSize);

View file

@ -4,6 +4,7 @@
// license. You should have receive a LICENSE.md file along with the code. // license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz // If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#include "GUIDefs.h"
#include "GUIComponents.h" #include "GUIComponents.h"
#include "ColorHelpers.h" #include "ColorHelpers.h"
#include <complex> #include <complex>
@ -17,11 +18,13 @@
#include "utility/vstgui_after.h" #include "utility/vstgui_after.h"
#include "absl/strings/numbers.h" #include "absl/strings/numbers.h"
using namespace gui;
/// ///
SBoxContainer::SBoxContainer(const CRect& size) SBoxContainer::SBoxContainer(const CRect& size)
: CViewContainer(size) : CViewContainer(size)
{ {
CViewContainer::setBackgroundColor(CColor(0, 0, 0, 0)); CViewContainer::setBackgroundColor(kColorTransparent);
} }
void SBoxContainer::setCornerRadius(CCoord radius) void SBoxContainer::setCornerRadius(CCoord radius)
@ -644,24 +647,24 @@ SKnobCCBox::SKnobCCBox(const CRect& size, IControlListener* listener, int32_t ta
menuEntry_(makeOwned<CMenuItem>("Use HDCC", tag)), menuEntry_(makeOwned<CMenuItem>("Use HDCC", tag)),
menuListener_(owned(new MenuListener(*this))) menuListener_(owned(new MenuListener(*this)))
{ {
setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); setBackgroundColor(kColorTransparent);
label_->setText("Parameter"); label_->setText("Parameter");
label_->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); label_->setBackColor(kColorTransparent);
label_->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); label_->setFrameColor(kColorTransparent);
label_->setFontColor(CColor(0x00, 0x00, 0x00, 0xff)); label_->setFontColor(kBlackCColor);
knob_->setLineIndicatorColor(CColor(0x00, 0x00, 0x00, 0xff)); knob_->setLineIndicatorColor(kBlackCColor);
ccLabel_->setText("CC 1"); ccLabel_->setText("CC 1");
ccLabel_->setStyle(CParamDisplay::kRoundRectStyle); ccLabel_->setStyle(CParamDisplay::kRoundRectStyle);
ccLabel_->setRoundRectRadius(5.0); ccLabel_->setRoundRectRadius(5.0);
ccLabel_->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); ccLabel_->setFrameColor(kColorTransparent);
ccLabel_->setFontColor(CColor(0xff, 0xff, 0xff)); ccLabel_->setFontColor(kWhiteCColor);
valueEdit_->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); valueEdit_->setBackColor(kColorTransparent);
valueEdit_->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); valueEdit_->setFrameColor(kColorTransparent);
valueEdit_->setFontColor(CColor(0x00, 0x00, 0x00, 0xff)); valueEdit_->setFontColor(kBlackCColor);
valueEdit_->registerViewListener(this); valueEdit_->registerViewListener(this);
setHDMode(false); setHDMode(false);
valueEdit_->setVisible(false); valueEdit_->setVisible(false);
@ -882,7 +885,7 @@ SControlsPanel::SControlsPanel(const CRect& size)
// slot 0 always exists, keep the default style on the views there // slot 0 always exists, keep the default style on the views there
getOrCreateSlot(0); getOrCreateSlot(0);
setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); setBackgroundColor(kColorTransparent);
setScrollbarWidth(10.0); setScrollbarWidth(10.0);
@ -1055,9 +1058,9 @@ void SControlsPanel::recalculateSubViews()
// maybe the operation just created the scroll bar // maybe the operation just created the scroll bar
if (CScrollbar* vsb = getVerticalScrollbar()) { if (CScrollbar* vsb = getVerticalScrollbar()) {
// update scrollbar style // update scrollbar style
vsb->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); vsb->setFrameColor(kColorTransparent);
vsb->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); vsb->setBackgroundColor(kColorTransparent);
vsb->setScrollerColor(CColor(0x00, 0x00, 0x00, 0x80)); vsb->setScrollerColor(kColorControlsScroller);
} }
} }

View file

@ -0,0 +1,25 @@
// SPDX-License-Identifier: BSD-2-Clause
// This code is part of the sfizz library and is licensed under a BSD 2-clause
// license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#include "GUIDefs.h"
#include "utility/vstgui_before.h"
#include "vstgui/lib/ccolor.h"
#include "utility/vstgui_after.h"
namespace gui {
const CColor kColorSemiTransparent { CColor(0x00, 0x00, 0x00, 0x99) };
const CColor kColorTransparent { CColor(0x00, 0x00, 0x00, 0x00) };
const CColor kColorTransparentDark { CColor(0x00, 0x00, 0x00, 0xc0) };
const CColor kColorOrange { CColor(0xfd, 0x98, 0x00, 0xff) };
const CColor kColorControlsScroller { CColor(0x00, 0x00, 0x00, 0x80) };
const CColor kColorMeterDanger { CColor(0x00, 0xaa, 0x11) };
const CColor kColorMeterNormal { CColor(0xaa, 0x00, 0x00) };
const CColor kColorTooltipBackground { CColor(0xff, 0xff, 0xd2, 0xff) };
}

View file

@ -0,0 +1,27 @@
// SPDX-License-Identifier: BSD-2-Clause
// This code is part of the sfizz library and is licensed under a BSD 2-clause
// license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#pragma once
#include "utility/vstgui_before.h"
#include "vstgui/lib/vstguifwd.h"
#include "utility/vstgui_after.h"
using VSTGUI::CColor;
namespace gui {
extern const CColor kColorSemiTransparent;
extern const CColor kColorTransparent;
extern const CColor kColorTransparentDark;
extern const CColor kColorOrange;
extern const CColor kColorControlsScroller;
extern const CColor kColorMeterDanger;
extern const CColor kColorMeterNormal;
extern const CColor kColorTooltipBackground;
}