|
|
@@ -886,23 +886,26 @@ struct VCVLatch : VCVButton { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
/** Looks best with MediumSimpleLight<WhiteLight> or a color of your choice. |
|
|
|
*/ |
|
|
|
template <typename TLight> |
|
|
|
struct VCVLightButton : VCVButton { |
|
|
|
template <typename TBase, typename TLight = WhiteLight> |
|
|
|
struct LightButton : TBase { |
|
|
|
app::ModuleLightWidget* light; |
|
|
|
|
|
|
|
VCVLightButton() { |
|
|
|
LightButton() { |
|
|
|
light = new TLight; |
|
|
|
// Move center of light to center of box |
|
|
|
light->box.pos = box.size.div(2).minus(light->box.size.div(2)); |
|
|
|
addChild(light); |
|
|
|
light->box.pos = this->box.size.div(2).minus(light->box.size.div(2)); |
|
|
|
this->addChild(light); |
|
|
|
} |
|
|
|
|
|
|
|
app::ModuleLightWidget* getLight() { |
|
|
|
return light; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
template <typename TLight = WhiteLight> |
|
|
|
using VCVLightButton = LightButton<VCVButton, TLight>; |
|
|
|
|
|
|
|
/** Deprecated alias */ |
|
|
|
template <typename TLight> |
|
|
|
using LEDLightButton = VCVLightButton<TLight>; |
|
|
|
|
|
|
|