Reader: rationalize "Back" key/action handling (#6840)

Have ReaderBack be the sole handler of onBack.
Add 4 mutually exclusive options for the Back key,
to avoid ReaderLink and ReaderBack location stacks
from interfering (ReaderBack's stack being always a
superset of ReaderLink's stack).
So, remove "Enable back history", which is replaced
by Back option "Go to previous read page".
Fix a few possible crashes and inconsistencies (when
zoom, scroll or reflow have changed) with ReaderPaging
and ReaderView when restoring previous page/view.
This commit is contained in:
poire-z
2020-11-03 22:51:11 +01:00
committed by GitHub
parent 74c1813a82
commit 8403154d4d
9 changed files with 243 additions and 69 deletions

View File

@@ -41,11 +41,8 @@ function ReaderLink:init()
doc = "go to selected page link",
event = "GotoSelectedPageLink",
}
self.key_events.GoBackLink = {
{ "Back" },
doc = "go back from link",
event = "GoBackLink",
}
-- "Back" is handled by ReaderBack, which will call our onGoBackLink()
-- when G_reader_settings:readSetting("back_in_reader") == "previous_location"
end
if Device:isTouchDevice() then
self.ui:registerTouchZones({