diff --git a/base b/base index ab837d73b..4a91eefe3 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit ab837d73bae87efeb92950b4f00b6b55e5d45927 +Subproject commit 4a91eefe3a42f926ebe262658c258c9929544836 diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index 5e1d24dff..cbf15737f 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -258,6 +258,11 @@ function ReaderRolling:onCloseDocument() end end logger.dbg("cre cache used:", cache_file_path or "none") + -- Unknown elements and attributes, uncomment if needed for debugging: + -- local elements, attributes, namespaces = self.ui.document:getUnknownEntities() + -- if elements ~= "" then logger.info("cre unknown elements: ", elements) end + -- if attributes ~= "" then logger.info("cre unknown attributes: ", attributes) end + -- if namespaces ~= "" then logger.info("cre unknown namespaces: ", namespaces) end end function ReaderRolling:onCheckDomStyleCoherence() diff --git a/frontend/document/credocument.lua b/frontend/document/credocument.lua index 5d16baf11..4f171c245 100644 --- a/frontend/document/credocument.lua +++ b/frontend/document/credocument.lua @@ -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