[UX] Gesture manager: add actions - prev/next chapter (#4692)

Also adds rudimentary support for these in ReaderPaging.
This commit is contained in:
poire-z
2019-03-01 14:54:38 +01:00
committed by Frans de Jonge
parent 1475acdae7
commit 1e4469fec2
3 changed files with 34 additions and 4 deletions

View File

@@ -959,4 +959,26 @@ function ReaderPaging:onGotoPercentage(percentage)
return true
end
-- These might need additional work to behave fine in scroll
-- mode, and other zoom modes than Fit page
function ReaderPaging:onGotoNextChapter()
local pageno = self.current_page
local new_page = self.ui.toc:getNextChapter(pageno, 0)
if new_page then
self.ui.link:addCurrentLocationToStack()
self:onGotoPage(new_page)
end
return true
end
function ReaderPaging:onGotoPrevChapter()
local pageno = self.current_page
local new_page = self.ui.toc:getPreviousChapter(pageno, 0)
if new_page then
self.ui.link:addCurrentLocationToStack()
self:onGotoPage(new_page)
end
return true
end
return ReaderPaging