mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
cleanup readerui init for pdf
This commit is contained in:
@@ -400,8 +400,9 @@ function ReaderPaging:getTopPage()
|
||||
end
|
||||
|
||||
function ReaderPaging:onInitScrollPageStates(orig)
|
||||
--DEBUG.traceback()
|
||||
DEBUG("init scroll page states", orig)
|
||||
if self.view.page_scroll then
|
||||
if self.view.page_scroll and self.view.state.page then
|
||||
self.orig_page = self.current_page
|
||||
self.view.page_states = {}
|
||||
local blank_area = Geom:new{}
|
||||
@@ -734,6 +735,7 @@ end
|
||||
|
||||
-- wrapper for bounds checking
|
||||
function ReaderPaging:gotoPage(number, orig)
|
||||
--DEBUG.traceback()
|
||||
if number == self.current_page or not number then
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -176,25 +176,6 @@ function ReaderUI:init()
|
||||
end
|
||||
-- for page specific controller
|
||||
if self.document.info.has_pages then
|
||||
-- if needed, insert a paging container
|
||||
table.insert(self, ReaderPaging:new{
|
||||
dialog = self.dialog,
|
||||
view = self[1],
|
||||
ui = self
|
||||
})
|
||||
-- zooming controller
|
||||
self.zoom = ReaderZooming:new{
|
||||
dialog = self.dialog,
|
||||
view = self[1],
|
||||
ui = self
|
||||
}
|
||||
table.insert(self, self.zoom) -- hold reference to zoom controller
|
||||
-- panning controller
|
||||
table.insert(self, ReaderPanning:new{
|
||||
dialog = self.dialog,
|
||||
view = self[1],
|
||||
ui = self
|
||||
})
|
||||
-- cropping controller
|
||||
table.insert(self, ReaderCropping:new{
|
||||
dialog = self.dialog,
|
||||
@@ -202,10 +183,29 @@ function ReaderUI:init()
|
||||
ui = self,
|
||||
document = self.document,
|
||||
})
|
||||
-- zooming controller
|
||||
local zoom = ReaderZooming:new{
|
||||
dialog = self.dialog,
|
||||
view = self[1],
|
||||
ui = self
|
||||
}
|
||||
table.insert(self, zoom)
|
||||
-- paging controller
|
||||
table.insert(self, ReaderPaging:new{
|
||||
dialog = self.dialog,
|
||||
view = self[1],
|
||||
ui = self
|
||||
})
|
||||
-- panning controller
|
||||
table.insert(self, ReaderPanning:new{
|
||||
dialog = self.dialog,
|
||||
view = self[1],
|
||||
ui = self
|
||||
})
|
||||
-- hinting controller
|
||||
table.insert(self, ReaderHinting:new{
|
||||
dialog = self.dialog,
|
||||
zoom = self.zoom,
|
||||
zoom = zoom,
|
||||
view = self[1],
|
||||
ui = self,
|
||||
document = self.document,
|
||||
|
||||
Reference in New Issue
Block a user