mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
8466af2c5b
Adds configuration to the top corners as well as the additional gestures hold and two-finger tap. Deprecates `DTAP_ZONE_FLIPPING` and `DTAP_ZONE_BOOKMARK`. Fixes #4877.
31 lines
888 B
Lua
31 lines
888 B
Lua
local Geom = require("ui/geometry")
|
|
local ImageWidget = require("ui/widget/imagewidget")
|
|
local InputContainer = require("ui/widget/container/inputcontainer")
|
|
local LeftContainer = require("ui/widget/container/leftcontainer")
|
|
local Screen = require("device").screen
|
|
|
|
local ReaderFlipping = InputContainer:new{
|
|
orig_reflow_mode = 0,
|
|
}
|
|
|
|
function ReaderFlipping:init()
|
|
local widget = ImageWidget:new{
|
|
file = "resources/icons/appbar.book.open.png",
|
|
}
|
|
self[1] = LeftContainer:new{
|
|
dimen = Geom:new{w = Screen:getWidth(), h = widget:getSize().h},
|
|
widget,
|
|
}
|
|
self:resetLayout()
|
|
end
|
|
|
|
function ReaderFlipping:resetLayout()
|
|
local new_screen_width = Screen:getWidth()
|
|
if new_screen_width == self._last_screen_width then return end
|
|
self._last_screen_width = new_screen_width
|
|
|
|
self[1].dimen.w = new_screen_width
|
|
end
|
|
|
|
return ReaderFlipping
|