From 1dccc29c7d437e64fa956e2e364329c22848477a Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Sat, 6 Oct 2012 14:43:21 +0100 Subject: [PATCH 1/2] Show the current rendering mode in DjVu info Although the current rendering mode can also be ascertained by pressing "R" and noting the current position in the menu, it is convenient to show it alongside the page type in the Menu status info. --- djvureader.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/djvureader.lua b/djvureader.lua index 82b517686..8d93c8478 100644 --- a/djvureader.lua +++ b/djvureader.lua @@ -70,6 +70,24 @@ function DJVUReader:invertTextYAxel(pageno, text_table) return text_table end +function render_mode_string(rm) + if (rm == 0) then + return "COLOUR" + elseif (rm == 1) then + return "B&W" + elseif (rm == 2) then + return "COLOUR ONLY" + elseif (rm == 3) then + return "MASK ONLY" + elseif (rm == 4) then + return "COLOUR BG" + elseif (rm == 5) then + return "COLOUR FG" + else + return "UNKNOWN" + end +end + function DJVUReader:_drawReadingInfo() local width, height = G_width, G_height local numpages = self.doc:getPages() @@ -88,7 +106,8 @@ function DJVUReader:_drawReadingInfo() renderUtf8Text(fb.bb, 10, 15+6+22, face, "Gm:"..string.format("%.1f",self.globalgamma).." ["..tostring(page_gamma).."], ".. tostring(page_width).."x"..tostring(page_height)..", ".. - tostring(page_dpi).."dpi, "..page_type, true) + tostring(page_dpi).."dpi, "..page_type..", ".. + render_mode_string(self.render_mode), true) -- display reading progress on bottom of page local ypos = height - 50 From 49459945168c588c8e7084417986929f31c9b5bb Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Sat, 6 Oct 2012 15:00:02 +0100 Subject: [PATCH 2/2] Flush the date/time and battery info to the right. Because it looks nicer that way. --- djvureader.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/djvureader.lua b/djvureader.lua index 8d93c8478..05ce15267 100644 --- a/djvureader.lua +++ b/djvureader.lua @@ -100,9 +100,10 @@ function DJVUReader:_drawReadingInfo() renderUtf8Text(fb.bb, 10, 15+6, face, "M: ".. math.ceil( self.cache_current_memsize / 1024 ).."/"..math.ceil( self.cache_max_memsize / 1024 ).."k, ".. - math.ceil( self.doc:getCacheSize() / 1024 ).."/"..math.ceil( self.cache_document_size / 1024 ).."k, ".. - os.date("%a %d %b %Y %T").. - " ["..BatteryLevel().."]", true) + math.ceil( self.doc:getCacheSize() / 1024 ).."/"..math.ceil( self.cache_document_size / 1024 ).."k", true) + local txt = os.date("%a %d %b %Y %T").." ["..BatteryLevel().."]" + local w = sizeUtf8Text(0, G_width, face, txt, true).x + renderUtf8Text(fb.bb, width - w - 10, 15+6, face, txt, true) renderUtf8Text(fb.bb, 10, 15+6+22, face, "Gm:"..string.format("%.1f",self.globalgamma).." ["..tostring(page_gamma).."], ".. tostring(page_width).."x"..tostring(page_height)..", "..