mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add content range method in BottomContainer
This commit is contained in:
@@ -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