When I set a button element to be disabled, by either unchecking the “Enabled” box or by setting
$w("#button2").disable();
the button will still have the same design as the regular button.
It becomes disabled indeed, so you can not interact with it, so the problem is strictly related to the visual design.
I want the button to look something like this:
Update: It seems that the disabled style is not working if it is a customized design.
The workaround that I found was to create another button with the regular style greyed out and also remove the link-to option. That button will be placed in the same position, and the states will be simply handled by this:
$w("#button3").hide();
$w("#button5").show();
Seems like a good workaround.