mirror of
https://github.com/airstruck/luigi.git
synced 2025-11-18 12:25:06 +00:00
minor
This commit is contained in:
@@ -157,9 +157,7 @@ in the same layout, or in the master layout if one exists.
|
||||
--]]--
|
||||
Attribute.status = {}
|
||||
|
||||
function Attribute.status.get (widget, value)
|
||||
return cascade(widget, 'status')
|
||||
end
|
||||
Attribute.status.get = cascade
|
||||
|
||||
--[[--
|
||||
Scroll ability.
|
||||
@@ -364,9 +362,7 @@ function Attribute.font.set (widget, value)
|
||||
widget.textData = nil
|
||||
end
|
||||
|
||||
function Attribute.font.get (widget)
|
||||
return cascade(widget, 'font')
|
||||
end
|
||||
Attribute.font.get = cascade
|
||||
|
||||
--[[--
|
||||
Font size.
|
||||
@@ -386,9 +382,7 @@ function Attribute.size.set (widget, value)
|
||||
widget.textData = nil
|
||||
end
|
||||
|
||||
function Attribute.size.get (widget)
|
||||
return cascade(widget, 'size')
|
||||
end
|
||||
Attribute.size.get = cascade
|
||||
|
||||
--[[--
|
||||
Text Attributes.
|
||||
@@ -427,9 +421,7 @@ function Attribute.color.set (widget, value)
|
||||
widget.textData = nil
|
||||
end
|
||||
|
||||
function Attribute.color.get (widget)
|
||||
return cascade(widget, 'color')
|
||||
end
|
||||
Attribute.color.get = cascade
|
||||
|
||||
--[[--
|
||||
Text and icon alignment.
|
||||
@@ -451,9 +443,7 @@ function Attribute.align.set (widget, value)
|
||||
widget.textData = nil
|
||||
end
|
||||
|
||||
function Attribute.align.get (widget)
|
||||
return cascade(widget, 'align')
|
||||
end
|
||||
Attribute.align.get = cascade
|
||||
|
||||
--[[--
|
||||
Wrap text onto multiple lines.
|
||||
@@ -473,9 +463,7 @@ function Attribute.wrap.set (widget, value)
|
||||
widget.textData = nil
|
||||
end
|
||||
|
||||
function Attribute.wrap.get (widget)
|
||||
return cascade(widget, 'wrap')
|
||||
end
|
||||
Attribute.wrap.get = cascade
|
||||
|
||||
--[[--
|
||||
Visual Attributes.
|
||||
|
||||
@@ -55,7 +55,8 @@ local function metaIndex (self, property)
|
||||
-- look in widget's own attributes
|
||||
local A = Attribute[property]
|
||||
if A then
|
||||
local value = A.get and A.get(self) or self.attributes[property]
|
||||
local value = A.get and A.get(self, property)
|
||||
or self.attributes[property]
|
||||
if type(value) == 'function' then value = value(self) end
|
||||
if value ~= nil then return value end
|
||||
end
|
||||
@@ -78,7 +79,7 @@ local function metaNewIndex (self, property, value)
|
||||
local A = Attribute[property]
|
||||
if A then
|
||||
if A.set then
|
||||
A.set(self, value)
|
||||
A.set(self, value, property)
|
||||
else
|
||||
self.attributes[property] = value
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user