mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-11 08:48:23 +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 = {}
|
Attribute.status = {}
|
||||||
|
|
||||||
function Attribute.status.get (widget, value)
|
Attribute.status.get = cascade
|
||||||
return cascade(widget, 'status')
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[--
|
--[[--
|
||||||
Scroll ability.
|
Scroll ability.
|
||||||
@@ -364,9 +362,7 @@ function Attribute.font.set (widget, value)
|
|||||||
widget.textData = nil
|
widget.textData = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Attribute.font.get (widget)
|
Attribute.font.get = cascade
|
||||||
return cascade(widget, 'font')
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[--
|
--[[--
|
||||||
Font size.
|
Font size.
|
||||||
@@ -386,9 +382,7 @@ function Attribute.size.set (widget, value)
|
|||||||
widget.textData = nil
|
widget.textData = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Attribute.size.get (widget)
|
Attribute.size.get = cascade
|
||||||
return cascade(widget, 'size')
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[--
|
--[[--
|
||||||
Text Attributes.
|
Text Attributes.
|
||||||
@@ -427,9 +421,7 @@ function Attribute.color.set (widget, value)
|
|||||||
widget.textData = nil
|
widget.textData = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Attribute.color.get (widget)
|
Attribute.color.get = cascade
|
||||||
return cascade(widget, 'color')
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[--
|
--[[--
|
||||||
Text and icon alignment.
|
Text and icon alignment.
|
||||||
@@ -451,9 +443,7 @@ function Attribute.align.set (widget, value)
|
|||||||
widget.textData = nil
|
widget.textData = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Attribute.align.get (widget)
|
Attribute.align.get = cascade
|
||||||
return cascade(widget, 'align')
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[--
|
--[[--
|
||||||
Wrap text onto multiple lines.
|
Wrap text onto multiple lines.
|
||||||
@@ -473,9 +463,7 @@ function Attribute.wrap.set (widget, value)
|
|||||||
widget.textData = nil
|
widget.textData = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Attribute.wrap.get (widget)
|
Attribute.wrap.get = cascade
|
||||||
return cascade(widget, 'wrap')
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[--
|
--[[--
|
||||||
Visual Attributes.
|
Visual Attributes.
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ local function metaIndex (self, property)
|
|||||||
-- look in widget's own attributes
|
-- look in widget's own attributes
|
||||||
local A = Attribute[property]
|
local A = Attribute[property]
|
||||||
if A then
|
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 type(value) == 'function' then value = value(self) end
|
||||||
if value ~= nil then return value end
|
if value ~= nil then return value end
|
||||||
end
|
end
|
||||||
@@ -78,7 +79,7 @@ local function metaNewIndex (self, property, value)
|
|||||||
local A = Attribute[property]
|
local A = Attribute[property]
|
||||||
if A then
|
if A then
|
||||||
if A.set then
|
if A.set then
|
||||||
A.set(self, value)
|
A.set(self, value, property)
|
||||||
else
|
else
|
||||||
self.attributes[property] = value
|
self.attributes[property] = value
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user