support goto relative page number

We can input relative page number now in the reader goto dialog.
Goto "+4" will page forward 4 pages and goto "-4" will page
backward 4 pages.

This implements #1437.
This commit is contained in:
chrox
2015-03-12 15:45:58 +08:00
parent ea76d91ed4
commit 992e769aaf
3 changed files with 25 additions and 18 deletions

View File

@@ -331,6 +331,14 @@ function ReaderRolling:onGotoPage(number)
return true
end
function ReaderRolling:onGotoRelativePage(number)
if number then
self:gotoPage(self.current_page + number)
end
self.xpointer = self.ui.document:getXPointer()
return true
end
function ReaderRolling:onGotoXPointer(xp)
self:gotoXPointer(xp)
self.xpointer = xp