Update docs, annotations and style for checkbox

This commit is contained in:
Insality
2022-02-12 17:17:36 +02:00
parent 4e0fd264b1
commit 3b329f9c25
38 changed files with 67 additions and 48 deletions

View File

@@ -88,9 +88,15 @@ M["progress"] = {
M["checkbox"] = {
on_change_state = function(self, node, state)
on_change_state = function(self, node, state, is_instant)
local target = state and 1 or 0
gui.animate(node, "color.w", target, gui.EASING_OUTSINE, 0.1)
if not is_instant then
gui.animate(node, "color.w", target, gui.EASING_OUTSINE, 0.1)
else
local color = gui.get_color(node)
color.w = target
gui.set_color(node, color)
end
end
}