mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
6d30f679c5
Bookmark flipping mode is toggled when long-holding the upper-right corner of the screen. In this mood both the flipping icon and the dogear icon are shown. And swiping west and east in this mode will flipping only on bookmarked pages. Currently only pdf/djvu readers are supported. This should implement feature request in #154.
45 lines
1.1 KiB
Lua
45 lines
1.1 KiB
Lua
local InputContainer = require("ui/widget/container/inputcontainer")
|
|
local LeftContainer = require("ui/widget/container/leftcontainer")
|
|
local ImageWidget = require("ui/widget/imagewidget")
|
|
local GestureRange = require("ui/gesturerange")
|
|
local Device = require("ui/device")
|
|
local Geom = require("ui/geometry")
|
|
local Screen = require("ui/screen")
|
|
local Event = require("ui/event")
|
|
|
|
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,
|
|
}
|
|
if Device:isTouchDevice() then
|
|
self.ges_events = {
|
|
Tap = {
|
|
GestureRange:new{
|
|
ges = "tap",
|
|
range = Geom:new{
|
|
x = Screen:getWidth()*DTAP_ZONE_FLIPPING.x,
|
|
y = Screen:getHeight()*DTAP_ZONE_FLIPPING.y,
|
|
w = Screen:getWidth()*DTAP_ZONE_FLIPPING.w,
|
|
h = Screen:getHeight()*DTAP_ZONE_FLIPPING.h
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
end
|
|
|
|
function ReaderFlipping:onTap()
|
|
self.ui:handleEvent(Event:new("TogglePageFlipping"))
|
|
return true
|
|
end
|
|
|
|
return ReaderFlipping
|