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,17 @@
|
||||
--[[--
|
||||
A radio button.
|
||||
|
||||
Radio buttons change their @{attribute.value|value} attribute to
|
||||
`true` when pressed. Radio buttons should also have a `group`
|
||||
attribute. When a radio button is pressed, other radio buttons
|
||||
in the same layout with the same `group` attribute change their values
|
||||
to `false`.
|
||||
|
||||
Changing the value of a radio button 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 radio
|
||||
--]]--
|
||||
|
||||
@@ -24,10 +35,5 @@ return function (self)
|
||||
end
|
||||
end)
|
||||
|
||||
self:onChange(function ()
|
||||
local subtype = self.value and 'radio.checked' or 'radio.unchecked'
|
||||
self.type = { 'radio', subtype }
|
||||
end)
|
||||
|
||||
self.value = not not self.value
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user