mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
bump_crengine: various fixes, tweaks and cleanups (#6188)
Includes: - Don't reset invisible BR to display: inline - ldomTextCollector: handle inline-block/table as inline - Avoid re-rendering on font hinting mode change - List markers: fix positionning when floats involved - GIF decoding: avoid uneeded abort on LZW table overflow - Adds getUnknownEntities(), can help with debugging - Don't check stylesheet hashes when loading from cache - Hardcoded elements and attributes list: cleanup - Full rendering: 2 small optimisations - Strut confinning: deal with images earlier - lvtextfm: some cleanup and reordering cre.cpp: - fix getPageFromXPointer() and getPosFromXPointer() to not fail on invisible nodes and work on the next visible node (so links whose target is display:none can work). Add support for 2 settings one can set manually in reader.settings.reader.lua: ["cre_background_color"] = "0xccffcc", ["cre_background_image"] = "/path/to/bg_paper.jpg",
This commit is contained in:
@@ -205,6 +205,14 @@ function CreDocument:setupDefaultView()
|
||||
self._document:setIntProperty("crengine.page.header.font.size",
|
||||
G_reader_settings:readSetting("cre_header_status_font_size"))
|
||||
end
|
||||
|
||||
-- One can set these to change from white background
|
||||
if G_reader_settings:readSetting("cre_background_color") then
|
||||
self:setBackgroundColor(G_reader_settings:readSetting("cre_background_color"))
|
||||
end
|
||||
if G_reader_settings:readSetting("cre_background_image") then
|
||||
self:setBackgroundImage(G_reader_settings:readSetting("cre_background_image"))
|
||||
end
|
||||
end
|
||||
|
||||
function CreDocument:loadDocument(full_document)
|
||||
@@ -893,6 +901,11 @@ function CreDocument:setStatusLineProp(prop)
|
||||
self._document:setStringProperty("window.status.line", prop)
|
||||
end
|
||||
|
||||
function CreDocument:setBackgroundColor(bgcolor) -- use nil to set to white
|
||||
logger.dbg("CreDocument: set background color", bgcolor)
|
||||
self._document:setBackgroundColor(bgcolor)
|
||||
end
|
||||
|
||||
function CreDocument:setBackgroundImage(img_path) -- use nil to unset
|
||||
logger.dbg("CreDocument: set background image", img_path)
|
||||
self._document:setBackgroundImage(img_path)
|
||||
@@ -941,6 +954,10 @@ function CreDocument:getStatistics()
|
||||
return self._document:getStatistics()
|
||||
end
|
||||
|
||||
function CreDocument:getUnknownEntities()
|
||||
return self._document:getUnknownEntities()
|
||||
end
|
||||
|
||||
function CreDocument:canHaveAlternativeToc()
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user