delayed calling of gotoXPointer when internal properties are changed

This should fix #400 and fix #300.
pull/415/head
chrox 10 years ago
parent b0d27a021d
commit b5fd38f897

@ -6,6 +6,7 @@ local Input = require("ui/input")
local Event = require("ui/event")
local GestureRange = require("ui/gesturerange")
local ReaderPanning = require("ui/reader/readerpanning")
local UIManager = require("ui/uimanager")
local DEBUG = require("dbg")
local _ = require("gettext")
@ -243,7 +244,7 @@ end
function ReaderRolling:onZoom()
--@TODO re-read doc_height info after font or lineheight changes 05.06 2012 (houqp)
self:onUpdatePos()
self:updatePos()
end
--[[
@ -251,6 +252,11 @@ end
font has been changed, or line height has been changed.
--]]
function ReaderRolling:onUpdatePos()
UIManager:scheduleIn(0.1, function () self:updatePos() end)
return true
end
function ReaderRolling:updatePos()
-- reread document height
self.ui.document:_readMetadata()
-- update self.current_pos if the height of document has been changed.
@ -262,7 +268,6 @@ function ReaderRolling:onUpdatePos()
self.old_page = new_page
self.ui:handleEvent(Event:new("UpdateToc"))
end
return true
end
function ReaderRolling:onChangeViewMode()

@ -573,6 +573,7 @@ function ReaderView:onSetPageMargins(margins)
local right = margins[3]
local bottom = margins[4]
self.ui.document:setPageMargins(left, top, right, bottom)
self.ui:handleEvent(Event:new("UpdatePos"))
return true
end

@ -509,6 +509,7 @@ function ConfigDialog:onConfigChoice(option_name, option_value)
--DEBUG("config option value", option_name, option_value)
self.configurable[option_name] = option_value
self.ui:handleEvent(Event:new("StartActivityIndicator"))
self:closeDialog()
return true
end

Loading…
Cancel
Save