Skip to content

Commit

Permalink
Restore the named image hover overrides for switches (surge-synthesiz…
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Nov 25, 2021
1 parent c2aa1f0 commit d2d6e5d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4591,6 +4591,27 @@ SurgeGUIEditor::layoutComponentForSkin(std::shared_ptr<Surge::GUI::Skin::Control
hsw->setHoverSwitchDrawable(std::get<1>(drawables));
hsw->setHoverOnSwitchDrawable(std::get<2>(drawables));

auto bg = currentSkin->propertyValue(skinCtrl, Surge::Skin::Component::IMAGE);
if (bg.has_value())
{
auto hdb = bitmapStore->getImageByStringID(*bg);
hsw->setSwitchDrawable(hdb);
}

auto ho = currentSkin->propertyValue(skinCtrl, Surge::Skin::Component::HOVER_IMAGE);
if (ho.has_value())
{
auto hdb = bitmapStore->getImageByStringID(*ho);
hsw->setHoverSwitchDrawable(hdb);
}

auto hoo = currentSkin->propertyValue(skinCtrl, Surge::Skin::Component::HOVER_ON_IMAGE);
if (hoo.has_value())
{
auto hdb = bitmapStore->getImageByStringID(*hoo);
hsw->setHoverOnSwitchDrawable(hdb);
}

hsw->setBounds(rect);
hsw->setSkin(currentSkin, bitmapStore, skinCtrl);

Expand Down

0 comments on commit d2d6e5d

Please sign in to comment.