mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
Formalize type attribute and support it in styles
This commit is contained in:
@@ -74,9 +74,13 @@ end
|
||||
local attributeNames = {}
|
||||
|
||||
for name in pairs(Attribute) do
|
||||
attributeNames[#attributeNames + 1] = name
|
||||
if name ~= 'type' then -- type must be handled last
|
||||
attributeNames[#attributeNames + 1] = name
|
||||
end
|
||||
end
|
||||
|
||||
attributeNames[#attributeNames + 1] = 'type'
|
||||
|
||||
--[[--
|
||||
Widget pseudo-constructor.
|
||||
|
||||
@@ -109,17 +113,6 @@ local function metaCall (Widget, layout, self)
|
||||
self[property] = value
|
||||
end
|
||||
|
||||
self.type = self.type or 'generic'
|
||||
self.fontData = Font(self.font, self.size, self.color)
|
||||
|
||||
-- layout:addWidget(self)
|
||||
|
||||
local decorate = Widget.typeDecorators[self.type]
|
||||
|
||||
if decorate then
|
||||
decorate(self)
|
||||
end
|
||||
|
||||
for k, v in ipairs(self) do
|
||||
self[k] = v.isWidget and v or metaCall(Widget, self.layout, v)
|
||||
self[k].parent = self
|
||||
|
||||
Reference in New Issue
Block a user