mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
simplify style system
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
--[[--
|
||||
A check box.
|
||||
|
||||
Check boxes toggle their @{attribute.value|value} attribute between
|
||||
`true` and `false` when pressed.
|
||||
|
||||
Changing the value of a check box causes it to change its appearance to
|
||||
indicate its value. The standard themes use the @{attribute.icon|icon}
|
||||
attribute for this purpose. If a custom icon is provided when using the
|
||||
standard themes, the widget's value should be indicated in some other way.
|
||||
|
||||
@widget check
|
||||
--]]--
|
||||
|
||||
@@ -9,10 +17,5 @@ return function (self)
|
||||
self.value = not self.value
|
||||
end)
|
||||
|
||||
self:onChange(function ()
|
||||
local subtype = self.value and 'check.checked' or 'check.unchecked'
|
||||
self.type = { 'check', subtype }
|
||||
end)
|
||||
|
||||
self.value = not not self.value
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user