Added missing backcolor to the ccknobs label in theme

should fix also the font size
This commit is contained in:
redtide 2021-04-13 21:33:41 +02:00
parent 5ec58b4bba
commit 2a0101675d
6 changed files with 33 additions and 18 deletions

View file

@ -17,6 +17,7 @@
<color name="knobLineIndicator">#000000</color>
<color name="knobText">#000000</color>
<color name="knobLabelText">#ffffff</color>
<color name="knobLabelBackground">#006b0b</color>
</palette>
<palette name="inverted">
<color name="boxBackground">#2e3436</color>
@ -34,5 +35,6 @@
<color name="knobLineIndicator">#ffffff</color>
<color name="knobText">#ffffff</color>
<color name="knobLabelText">#ffffff</color>
<color name="knobLabelBackground">#006b0b</color>
</palette>
</sfizz-theme>

View file

@ -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<CFontDesc>("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;
};

View file

@ -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());

View file

@ -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);

View file

@ -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);

View file

@ -31,6 +31,7 @@ struct Palette {
CColor knobLineIndicator;
CColor knobText;
CColor knobLabelText;
CColor knobLabelBackground;
};
struct Theme {