mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ConfigDialog: fix ButtonProgressWidget and some refreshes (#4793)
This internal ButtonProgressWidget widget was behaving differently from all others (OptionTextItem, OptionIconItem and ToggleSwitch) by duplicating some code from ConfigDialog:onConfigChoose() instead of calling it directly. While making it similar to others, I noticed that onConfigChoose() did a full repaint, which was necessary for some settings to be applied (ie: Contrast). On CreDocument, this full repaint may cause some double drawing on config changes (ie: Margins, drawing once after margin changes, and then re-positionning to previous xpointer). So, make the need for full repaint a condition on KoptOptions.
This commit is contained in:
@@ -643,6 +643,15 @@ function ReaderRolling:onUpdatePos()
|
||||
-- we have set above) to avoid multiple refreshes.
|
||||
return true
|
||||
end
|
||||
-- Calling this now ensures the re-rendering is done by crengine
|
||||
-- so the delayed updatePos() has good info and can reposition
|
||||
-- the previous xpointer accurately:
|
||||
self.ui.document:getCurrentPos()
|
||||
-- Otherwise, _readMetadata() would do that, but the positionning
|
||||
-- would not work as expected, for some reason (it worked
|
||||
-- previously because of some bad setDirty() in ConfigDialog widgets
|
||||
-- that were triggering a full repaint of crengine (so, the needed
|
||||
-- rerendering) before updatePos() is called.
|
||||
UIManager:scheduleIn(0.1, function () self:updatePos() end)
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user