mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Workaround for floating punctuation toggle in cre
crengine for some reason appears to unset font face and page margins after toggling floating punctuation
This commit is contained in:
@@ -30,7 +30,10 @@ function ReaderTypeset:onReadSettings(config)
|
||||
-- default to enable floating punctuation
|
||||
self.floating_punctuation = config:readSetting("floating_punctuation") or 1
|
||||
self.ui.document:setFloatingPunctuation(self.floating_punctuation)
|
||||
|
||||
self:_setPageMargins()
|
||||
end
|
||||
|
||||
function ReaderTypeset:_setPageMargins()
|
||||
local copt_margins = self.ui.doc_settings:readSetting("copt_page_margins") or DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM
|
||||
self.ui:handleEvent(Event:new("SetPageMargins", copt_margins))
|
||||
end
|
||||
@@ -112,7 +115,10 @@ end
|
||||
function ReaderTypeset:toggleFloatingPunctuation()
|
||||
self.floating_punctuation = self.floating_punctuation == 0 and 1 or 0
|
||||
self.ui.document:setFloatingPunctuation(self.floating_punctuation)
|
||||
self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
--self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
-- workaround: set again things unset by crengine after changing floating punctuation
|
||||
self.ui.document:setFontFace(self.ui.doc_settings:readSetting("font_face"))
|
||||
self:_setPageMargins()
|
||||
end
|
||||
|
||||
function ReaderTypeset:addToMainMenu(tab_item_table)
|
||||
|
||||
Reference in New Issue
Block a user