Skip to content

Commit

Permalink
Actually apply dialog checkbox colors to ToggleButton (#5454)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruselj authored Nov 23, 2021
1 parent f0a5482 commit 4490f0e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
3 changes: 1 addition & 2 deletions resources/data/skins/dark-mode.surge-skin/skin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@
<color id="dialog.textfield.text" value="lightgray"/>
<color id="dialog.label.text" value="lightgray"/>

<color id="dialog.checkbox.background" value="white"/>
<color id="dialog.checkbox.border" value="lightgray"/>
<color id="dialog.checkbox.tick" value="darkergray"/>
<color id="dialog.checkbox.tick" value="lightgray"/>

<color id="effect.label.separator" value="#5E5E5E"/>
<color id="effect.label.text" value="lightgray"/>
Expand Down
42 changes: 23 additions & 19 deletions src/surge-xt/gui/overlays/PatchStoreDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,32 @@ void PatchStoreDialog::onSkinChanged()
skin->getColor(Colors::Dialog::Entry::Border));
};

auto resetLabel = [this](const auto &label) {
label->setFont(skin->getFont(Fonts::PatchStore::Label));
label->setColour(juce::Label::textColourId, skin->getColor(Colors::Dialog::Label::Text));
};

resetColors(nameEd);
resetColors(authorEd);
resetColors(catEd);
resetColors(commentEd);

resetLabel(nameEdL);
resetLabel(authorEdL);
resetLabel(catEdL);
resetLabel(commentEdL);
resetLabel(storeTuningLabel);

#if HAS_TAGS_FIELD
resetLabel(tagEdL);
resetColors(tagEd);
#endif

storeTuningButton->setColour(juce::ToggleButton::tickDisabledColourId,
skin->getColor(Colors::Dialog::Checkbox::Border));
storeTuningButton->setColour(juce::ToggleButton::tickColourId,
skin->getColor(Colors::Dialog::Checkbox::Tick));

catEd->setColour(Surge::Widgets::TypeAhead::ColourIds::emptyBackgroundId,
skin->getColor(Colors::Dialog::Entry::Background));
catEd->setColour(Surge::Widgets::TypeAhead::ColourIds::borderid,
Expand All @@ -214,25 +237,6 @@ void PatchStoreDialog::onSkinChanged()
categoryProvider->hl = categoryProvider->txt;
categoryProvider->hlbg = skin->getColor(Colors::Dialog::Entry::Focus);

#if HAS_TAGS_FIELD
resetColors(tagEd);
#endif
resetColors(commentEd);

auto resetLabel = [this](const auto &label) {
label->setFont(skin->getFont(Fonts::PatchStore::Label));
label->setColour(juce::Label::textColourId, skin->getColor(Colors::Dialog::Label::Text));
};

resetLabel(nameEdL);
resetLabel(authorEdL);
#if HAS_TAGS_FIELD
resetLabel(tagEdL);
#endif
resetLabel(catEdL);
resetLabel(commentEdL);
resetLabel(storeTuningLabel);

okButton->setSkin(skin, associatedBitmapStore);
cancelButton->setSkin(skin, associatedBitmapStore);
okOverButton->setSkin(skin, associatedBitmapStore);
Expand Down

0 comments on commit 4490f0e

Please sign in to comment.