cre landscape view: adds 1 page / 2 pages toggable

Adds a toggle switch in the Orientation bottom config menu to
allow showing 1 page or 2 pages when in landscape mode.
Previously, this was hardcoded to be in 2-pages modes only
in some circumstances (device resolution + user dpi).
This commit is contained in:
poire-z
2019-03-13 13:07:30 +01:00
parent 0948a4b656
commit 22bc9dacb5
4 changed files with 84 additions and 7 deletions

View File

@@ -190,11 +190,12 @@ end
function CreDocument:render()
-- load document before rendering
self:loadDocument()
-- set visible page count in landscape
if math.max(CanvasContext:getWidth(), CanvasContext:getHeight()) / CanvasContext:getDPI()
< DCREREADER_TWO_PAGE_THRESHOLD then
self:setVisiblePageCount(1)
end
-- This is now configurable and done by ReaderRolling:
-- -- set visible page count in landscape
-- if math.max(CanvasContext:getWidth(), CanvasContext:getHeight()) / CanvasContext:getDPI()
-- < DCREREADER_TWO_PAGE_THRESHOLD then
-- self:setVisiblePageCount(1)
-- end
logger.dbg("CreDocument: rendering document...")
self._document:renderDocument()
self.info.doc_height = self._document:getFullHeight()