From d2d6e5dc65161df58c17dac43f33060b6530d257 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 25 Nov 2021 17:17:18 -0500 Subject: [PATCH] Restore the named image hover overrides for switches (#5497) Closes #5488 --- src/surge-xt/gui/SurgeGUIEditor.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp index cb8afac2c40..12d0b73d1e9 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.cpp +++ b/src/surge-xt/gui/SurgeGUIEditor.cpp @@ -4591,6 +4591,27 @@ SurgeGUIEditor::layoutComponentForSkin(std::shared_ptrsetHoverSwitchDrawable(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);