mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[UX] Gesture manager: corner gestures (#4878)
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.
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
local Device = require("device")
|
||||
local Event = require("ui/event")
|
||||
local Geom = require("ui/geometry")
|
||||
local GestureRange = require("ui/gesturerange")
|
||||
local ImageWidget = require("ui/widget/imagewidget")
|
||||
local InputContainer = require("ui/widget/container/inputcontainer")
|
||||
local RightContainer = require("ui/widget/container/rightcontainer")
|
||||
local Screen = require("device").screen
|
||||
local Screen = Device.screen
|
||||
|
||||
local ReaderDogear = InputContainer:new{}
|
||||
|
||||
@@ -70,30 +68,9 @@ end
|
||||
function ReaderDogear:resetLayout()
|
||||
local new_screen_width = Screen:getWidth()
|
||||
if new_screen_width == self._last_screen_width then return end
|
||||
local new_screen_height = Screen:getHeight()
|
||||
self._last_screen_width = new_screen_width
|
||||
|
||||
self[1].dimen.w = new_screen_width
|
||||
if Device:isTouchDevice() then
|
||||
self.ges_events = {
|
||||
Tap = {
|
||||
GestureRange:new{
|
||||
ges = "tap",
|
||||
range = Geom:new{
|
||||
x = new_screen_width*DTAP_ZONE_BOOKMARK.x,
|
||||
y = new_screen_height*DTAP_ZONE_BOOKMARK.y,
|
||||
w = new_screen_width*DTAP_ZONE_BOOKMARK.w,
|
||||
h = new_screen_height*DTAP_ZONE_BOOKMARK.h
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderDogear:onTap()
|
||||
self.ui:handleEvent(Event:new("ToggleBookmark"))
|
||||
return true
|
||||
end
|
||||
|
||||
function ReaderDogear:onSetDogearVisibility(visible)
|
||||
|
||||
Reference in New Issue
Block a user