mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderDogear: fix no y-offset after load with top status bar
This commit is contained in:
@@ -54,7 +54,7 @@ function ReaderDogear:setupDogear(new_dogear_size)
|
||||
end
|
||||
|
||||
function ReaderDogear:onReadSettings(config)
|
||||
if not self.ui.document.info.has_pages then
|
||||
if self.ui.rolling then
|
||||
-- Adjust to CreDocument margins (as done in ReaderTypeset)
|
||||
local h_margins = config:readSetting("copt_h_page_margins")
|
||||
or G_reader_settings:readSetting("copt_h_page_margins")
|
||||
@@ -71,7 +71,7 @@ function ReaderDogear:onReadSettings(config)
|
||||
end
|
||||
|
||||
function ReaderDogear:onSetPageMargins(margins)
|
||||
if self.ui.document.info.has_pages then
|
||||
if not self.ui.rolling then
|
||||
-- we may get called by readerfooter (when hiding the footer)
|
||||
-- on pdf documents and get margins=nil
|
||||
return
|
||||
@@ -86,7 +86,7 @@ function ReaderDogear:onSetPageMargins(margins)
|
||||
end
|
||||
|
||||
function ReaderDogear:updateDogearOffset()
|
||||
if self.ui.document.info.has_pages then
|
||||
if not self.ui.rolling then
|
||||
return
|
||||
end
|
||||
self.dogear_y_offset = 0
|
||||
@@ -101,6 +101,10 @@ function ReaderDogear:updateDogearOffset()
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderDogear:onReaderReady()
|
||||
self:updateDogearOffset()
|
||||
end
|
||||
|
||||
function ReaderDogear:onDocumentRerendered()
|
||||
-- Catching the top status bar toggling with :onSetStatusLine()
|
||||
-- would be too early. But "DocumentRerendered" is sent after
|
||||
|
||||
Reference in New Issue
Block a user