add content range method in BottomContainer
This commit is contained in:
1 parent
912a8a496b
commit
90d91d567a
1 file changed
+11
@@ -1,4 +1,5 @@
|
||||
local WidgetContainer = require("ui/widget/container/widgetcontainer")
|
||||
local Geom = require("ui/geometry")
|
||||
|
||||
--[[
|
||||
BottomContainer contains its content (1 widget) at the bottom of its own
|
||||
@@ -17,4 +18,14 @@ function BottomContainer:paintTo(bb, x, y)
|
||||
y + (self.dimen.h - contentSize.h))
|
||||
end
|
||||
|
||||
function BottomContainer:contentRange()
|
||||
local contentSize = self[1]:getSize()
|
||||
return Geom:new{
|
||||
x = (self.dimen.x or 0) + math.floor((self.dimen.w - contentSize.w)/2),
|
||||
y = (self.dimen.y or 0) + self.dimen.h - contentSize.h,
|
||||
w = contentSize.w,
|
||||
h = contentSize.h
|
||||
}
|
||||
end
|
||||
|
||||
return BottomContainer
|
||||
Reference in new issue
Block a user