From ded4425620084a198d5c979afd23633eba43383d Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 9 Aug 2023 19:00:09 -0400 Subject: [PATCH] Add LightButton to component library. --- include/componentlibrary.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/componentlibrary.hpp b/include/componentlibrary.hpp index 63dffd80..750551f7 100644 --- a/include/componentlibrary.hpp +++ b/include/componentlibrary.hpp @@ -886,23 +886,26 @@ struct VCVLatch : VCVButton { } }; -/** Looks best with MediumSimpleLight or a color of your choice. -*/ -template -struct VCVLightButton : VCVButton { +template +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 +using VCVLightButton = LightButton; + +/** Deprecated alias */ template using LEDLightButton = VCVLightButton;