mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Alt status bar: custom metadata support (#11463)
This commit is contained in:
@@ -33,6 +33,13 @@ local CreDocument = Document:extend{
|
||||
monospace_font = "Droid Sans Mono",
|
||||
header_font = "Noto Sans",
|
||||
|
||||
prop_to_cre_prop = { -- see cre lvtinydom.h
|
||||
title = "doc.title",
|
||||
authors = "doc.authors",
|
||||
series = "doc.series.name",
|
||||
series_index = "doc.series.number",
|
||||
},
|
||||
|
||||
-- Reasons for the fallback font ordering:
|
||||
-- - Noto Sans CJK SC before FreeSans/Serif, as it has nice and larger
|
||||
-- symbol glyphs for Wikipedia EPUB headings than both Free fonts)
|
||||
@@ -216,6 +223,14 @@ function CreDocument:getDocumentProps()
|
||||
return self._document:getDocumentProps()
|
||||
end
|
||||
|
||||
function CreDocument:setAltDocumentProp(prop, value)
|
||||
logger.dbg("CreDocument: set alt document prop", prop, value)
|
||||
if type(value) == "number" then -- series index
|
||||
value = tostring(value)
|
||||
end
|
||||
self._document:setAltDocumentProp(self.prop_to_cre_prop[prop], value)
|
||||
end
|
||||
|
||||
function CreDocument:setupDefaultView()
|
||||
if self.loaded then
|
||||
-- Don't apply defaults if the document has already been loaded
|
||||
|
||||
Reference in New Issue
Block a user