diff -r 43b2bff95289 -r b27e50143083 svghmi/widget_button.ysl2 --- a/svghmi/widget_button.ysl2 Mon Jun 20 09:30:11 2022 +0200 +++ b/svghmi/widget_button.ysl2 Wed Jun 22 11:48:40 2022 +0200 @@ -183,19 +183,13 @@ apply "$fsm", mode="actions"; | animate(){ - | if (this.active_elt && this.inactive_elt) { - foreach "str:split('active inactive')" { - | if(this.display == "«.»") - | this.«.»_elt.style.display = ""; - | else - | this.«.»_elt.style.display = "none"; - } - | } + | this.set_activation_state(this.display == "active"); | } | init() { | this.bound_onmouseup = this.onmouseup.bind(this); | this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); + | this.set_activation_state(undefined); | } } @@ -207,7 +201,7 @@ } widget_defs("Button") { - optional_labels("active inactive"); + activable(); } widget_class("PushButton"){ @@ -217,6 +211,6 @@ } widget_defs("PushButton") { - optional_labels("active inactive"); -} - + activable(); +} +