2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00

added jump-to-percent dialog for CREngine reader

This commit is contained in:
HW 2012-06-03 00:39:17 +02:00
parent e2af463bac
commit 22ce736e11

View File

@ -432,6 +432,22 @@ function CREReader:adjustCreReaderCommands()
self:goto(math.floor(self.doc:getFullHeight()*(keydef.keycode-KEY_1)/9))
end
)
self.commands:add(KEY_G,nil,"G",
"open 'go to position' input box",
function(unireader)
local height = self.doc:getFullHeight()
local position = NumInputBox:input(G_height-100, 100,
"Position in percent:", "current: "..math.floor((self.pos / height)*100), true)
-- convert string to number
if position and pcall(function () position = position + 0 end) then
if position >= 0 and position <= 100 then
self:goto(math.floor(height * position / 100))
return
end
end
self:redrawCurrentPage()
end
)
self.commands:add({KEY_F, KEY_AA}, nil, "F",
"change document font",
function(self)