diff --git a/plugins/editor/resources/Themes/Default/theme.xml b/plugins/editor/resources/Themes/Default/theme.xml index 66c7c1a0..7aac2b8a 100644 --- a/plugins/editor/resources/Themes/Default/theme.xml +++ b/plugins/editor/resources/Themes/Default/theme.xml @@ -17,6 +17,7 @@ #000000 #000000 #ffffff + #006b0b #2e3436 @@ -34,5 +35,6 @@ #ffffff #ffffff #ffffff + #006b0b diff --git a/plugins/editor/src/editor/Editor.cpp b/plugins/editor/src/editor/Editor.cpp index 16886887..f5b76c99 100644 --- a/plugins/editor/src/editor/Editor.cpp +++ b/plugins/editor/src/editor/Editor.cpp @@ -675,18 +675,6 @@ void Editor::Impl::createFrameContents() hline->setBackgroundColor(CColor(0xff, 0xff, 0xff, 0xff)); return hline; }; - auto createKnob48 = [this, &knob48](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) { - return new CAnimKnob(bounds, this, tag, 31, 48, knob48); - }; - auto createStyledKnob = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) { - SStyledKnob* knob = new SStyledKnob(bounds, this, tag); - OnThemeChanged.push_back([knob, palette]() { - knob->setActiveTrackColor(palette->knobActiveTrack); - knob->setInactiveTrackColor(palette->knobInactiveTrack); - knob->setLineIndicatorColor(palette->knobLineIndicator); - }); - return knob; - }; auto createValueLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) { CTextLabel* lbl = new CTextLabel(bounds, label); lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); @@ -869,6 +857,18 @@ void Editor::Impl::createFrameContents() menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); return menu; }; + auto createKnob48 = [this, &knob48](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) { + return new CAnimKnob(bounds, this, tag, 31, 48, knob48); + }; + auto createStyledKnob = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) { + SStyledKnob* knob = new SStyledKnob(bounds, this, tag); + OnThemeChanged.push_back([knob, palette]() { + knob->setActiveTrackColor(palette->knobActiveTrack); + knob->setInactiveTrackColor(palette->knobInactiveTrack); + knob->setLineIndicatorColor(palette->knobLineIndicator); + }); + return knob; + }; auto createKnobCCBox = [this, &palette](const CRect& bounds, int tag, const char* label, CHoriTxtAlign, int fontsize) { SKnobCCBox* box = new SKnobCCBox(bounds, this, tag); auto font = makeOwned("Roboto", fontsize); @@ -876,11 +876,10 @@ void Editor::Impl::createFrameContents() box->setNameLabelFont(font); box->setKnobFont(font); box->setCCLabelText(label); - box->setCCLabelFont(font); OnThemeChanged.push_back([box, palette]() { box->setNameLabelFontColor(palette->knobText); box->setCCLabelFontColor(palette->knobLabelText); - box->setCCLabelBackColor(palette->knobActiveTrack); + box->setCCLabelBackColor(palette->knobLabelBackground); box->setKnobFontColor(palette->knobText); box->setKnobLineIndicatorColor(palette->knobLineIndicator); box->setKnobActiveTrackColor(palette->knobActiveTrack); @@ -900,12 +899,13 @@ void Editor::Impl::createFrameContents() auto createControlsPanel = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { auto* panel = new SControlsPanel(bounds); OnThemeChanged.push_back([panel, palette]() { - panel->setNameLabelFontColor(palette->text); - panel->setCCLabelFontColor(palette->valueText); - panel->setKnobFontColor(palette->text); + panel->setNameLabelFontColor(palette->knobText); + panel->setCCLabelFontColor(palette->knobLabelText); + panel->setCCLabelBackColor(palette->knobLabelBackground); + panel->setKnobFontColor(palette->knobText); + panel->setKnobLineIndicatorColor(palette->knobLineIndicator); panel->setKnobActiveTrackColor(palette->knobActiveTrack); panel->setKnobInactiveTrackColor(palette->knobInactiveTrack); - panel->setKnobLineIndicatorColor(palette->knobLineIndicator); }); return panel; }; diff --git a/plugins/editor/src/editor/GUIComponents.cpp b/plugins/editor/src/editor/GUIComponents.cpp index 1166be24..5a179fae 100644 --- a/plugins/editor/src/editor/GUIComponents.cpp +++ b/plugins/editor/src/editor/GUIComponents.cpp @@ -795,6 +795,12 @@ void SControlsPanel::setCCLabelFont(CFontRef font) syncAllSlotStyles(); } +void SControlsPanel::setCCLabelBackColor(CColor color) +{ + slots_[0]->box->setCCLabelBackColor(color); + syncAllSlotStyles(); +} + void SControlsPanel::setCCLabelFontColor(CColor color) { slots_[0]->box->setCCLabelFontColor(color); @@ -935,6 +941,7 @@ void SControlsPanel::syncSlotStyle(uint32_t index) cur->setCCLabelFont(ref->getCCLabelFont()); cur->setCCLabelFontColor(ref->getCCLabelFontColor()); + cur->setCCLabelBackColor(ref->getCCLabelBackColor()); cur->setKnobActiveTrackColor(ref->getKnobActiveTrackColor()); cur->setKnobInactiveTrackColor(ref->getKnobInactiveTrackColor()); diff --git a/plugins/editor/src/editor/GUIComponents.h b/plugins/editor/src/editor/GUIComponents.h index d803fa86..fe577648 100644 --- a/plugins/editor/src/editor/GUIComponents.h +++ b/plugins/editor/src/editor/GUIComponents.h @@ -214,13 +214,16 @@ public: const CColor& getActiveTrackColor() const { return activeTrackColor_; } void setActiveTrackColor(const CColor& color); + const CColor& getInactiveTrackColor() const { return inactiveTrackColor_; } void setInactiveTrackColor(const CColor& color); + const CColor& getLineIndicatorColor() const { return lineIndicatorColor_; } void setLineIndicatorColor(const CColor& color); void setFont(CFontRef font); CFontRef getFont() const { return font_; } + void setFontColor(CColor fontColor); CColor getFontColor() const { return fontColor_; } @@ -312,6 +315,7 @@ public: void setNameLabelFont(CFontRef font); void setNameLabelFontColor(CColor color); void setCCLabelFont(CFontRef font); + void setCCLabelBackColor(CColor color); void setCCLabelFontColor(CColor color); void setKnobActiveTrackColor(CColor color); void setKnobInactiveTrackColor(CColor color); diff --git a/plugins/editor/src/editor/Theme.cpp b/plugins/editor/src/editor/Theme.cpp index 00342b86..351e3145 100644 --- a/plugins/editor/src/editor/Theme.cpp +++ b/plugins/editor/src/editor/Theme.cpp @@ -157,6 +157,7 @@ CColor* Theme::getColorFromName(absl::string_view name, bool fromInvertedPalette PALETTE_COLOR_CASE(knobLabelText); PALETTE_COLOR_CASE(knobLineIndicator); PALETTE_COLOR_CASE(knobText); + PALETTE_COLOR_CASE(knobLabelBackground); PALETTE_COLOR_CASE(text); PALETTE_COLOR_CASE(titleBoxBackground); PALETTE_COLOR_CASE(titleBoxText); diff --git a/plugins/editor/src/editor/Theme.h b/plugins/editor/src/editor/Theme.h index c67b5925..9e5d87a4 100644 --- a/plugins/editor/src/editor/Theme.h +++ b/plugins/editor/src/editor/Theme.h @@ -31,6 +31,7 @@ struct Palette { CColor knobLineIndicator; CColor knobText; CColor knobLabelText; + CColor knobLabelBackground; }; struct Theme {