From 33768b50a7343fe69542568fce7f55905eff9c80 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Mon, 8 Oct 2012 08:31:34 +0100 Subject: [PATCH 1/3] Explain Shift-R function in the help better 1. Explain the purpose of `Shift-R` function better in the help screen. 2. Show the range of valid values when the user presses `Shift-R`. --- unireader.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unireader.lua b/unireader.lua index cabb9bce8..db940462b 100644 --- a/unireader.lua +++ b/unireader.lua @@ -2513,10 +2513,10 @@ function UniReader:addAllCommands() end) self.commands:add(KEY_R, MOD_SHIFT, "R", - "full screen refresh", + "set full screen refresh count", function(unireader) local count = NumInputBox:input(G_height-100, 100, - "Full refresh after:", self.rcountmax, true) + "Full refresh every N pages (0-10)", self.rcountmax, true) -- convert string to number if pcall(function () count = math.floor(count) end) then if count < 0 then From a63140e9c84e563e563007acc693c9b1f17c5041 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Mon, 8 Oct 2012 10:39:40 +0100 Subject: [PATCH 2/3] Add "manual full screen refresh" on pressing Space Overloading the function "set full screen refresh count" (Shift-R) with forcing screen refresh is rather counter-intuitive and inconvenient in practice, because the InputBox dialog obscures the large part of the page and when it disappears it is not obvious whether the full page redraw occurred or not. Therefore, it is more convenient to have a separate function (bound to KEY_SPACE as in KPV's filemanager, K3Chess and in most other readers) that does the full screen refresh. --- unireader.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/unireader.lua b/unireader.lua index db940462b..1cf489554 100644 --- a/unireader.lua +++ b/unireader.lua @@ -2529,10 +2529,16 @@ function UniReader:addAllCommands() G_reader_settings:saveSetting("rcountmax", self.rcountmax) self.settings:saveSetting("rcountmax", self.rcountmax) end - -- now, perform full screen refresh + self:redrawCurrentPage() + end) + + self.commands:add(KEY_SPACE, nil, "Space", + "manual full screen refresh", + function(unireader) self.rcount = self.rcountmax self:redrawCurrentPage() end) + self.commands:add(KEY_Z,nil,"Z", "set crop mode", function(unireader) From e06069c147a2aa9436569c99e701e1524d22be7b Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Mon, 8 Oct 2012 11:13:59 +0100 Subject: [PATCH 3/3] Comment out a Debug() for page jumping. All those functions get called even if Debug() itself is a do-nothing, so this type of Debug()s should only be uncommented when needed. --- unireader.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unireader.lua b/unireader.lua index 1cf489554..ed757189b 100644 --- a/unireader.lua +++ b/unireader.lua @@ -2354,7 +2354,7 @@ function UniReader:addAllCommands() self.commands:addGroup("[1, 2 .. 9, 0]",numeric_keydefs, "jump to 0%, 10% .. 90%, 100% of document", function(unireader,keydef) - Debug('jump to page:', math.max(math.floor(unireader.doc:getPages()*(keydef.keycode-KEY_1)/9),1), '/', unireader.doc:getPages()) + --Debug('jump to page:', math.max(math.floor(unireader.doc:getPages()*(keydef.keycode-KEY_1)/9),1), '/', unireader.doc:getPages()) unireader:goto(math.max(math.floor(unireader.doc:getPages()*(keydef.keycode-KEY_1)/9),1)) end) -- end numeric keys