mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
cleanup: expand tab to 4 spaces
This commit is contained in:
@@ -19,10 +19,10 @@ It only setup the metabale (or prototype chain) and will not initiatie
|
||||
a real instance, i.e. call self:init()
|
||||
--]]
|
||||
function Widget:extend(o)
|
||||
local o = o or {}
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
return o
|
||||
local o = o or {}
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
return o
|
||||
end
|
||||
|
||||
--[[
|
||||
@@ -30,18 +30,18 @@ Use this method to initiatie a instance of a class, don't use it for class
|
||||
definition.
|
||||
--]]
|
||||
function Widget:new(o)
|
||||
o = self:extend(o)
|
||||
-- Both o._init and o.init are called on object create. But o._init is used
|
||||
-- for base widget initialization (basic component used to build other
|
||||
-- widgets). While o.init is for higher level widgets, for example Menu
|
||||
-- Widget
|
||||
if o._init then o:_init() end
|
||||
if o.init then o:init() end
|
||||
return o
|
||||
o = self:extend(o)
|
||||
-- Both o._init and o.init are called on object create. But o._init is used
|
||||
-- for base widget initialization (basic component used to build other
|
||||
-- widgets). While o.init is for higher level widgets, for example Menu
|
||||
-- Widget
|
||||
if o._init then o:_init() end
|
||||
if o.init then o:init() end
|
||||
return o
|
||||
end
|
||||
|
||||
function Widget:getSize()
|
||||
return self.dimen
|
||||
return self.dimen
|
||||
end
|
||||
|
||||
function Widget:paintTo(bb, x, y)
|
||||
|
||||
Reference in New Issue
Block a user