| @@ -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; | app::ModuleLightWidget* light; | ||||
| VCVLightButton() { | |||||
| LightButton() { | |||||
| light = new TLight; | light = new TLight; | ||||
| // Move center of light to center of box | // 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() { | app::ModuleLightWidget* getLight() { | ||||
| return light; | return light; | ||||
| } | } | ||||
| }; | }; | ||||
| template <typename TLight = WhiteLight> | |||||
| using VCVLightButton = LightButton<VCVButton, TLight>; | |||||
| /** Deprecated alias */ | |||||
| template <typename TLight> | template <typename TLight> | ||||
| using LEDLightButton = VCVLightButton<TLight>; | using LEDLightButton = VCVLightButton<TLight>; | ||||