|
|
|
@ -8,17 +8,46 @@ function ReaderMenu:onShowMenu()
|
|
|
|
|
local item_table = {}
|
|
|
|
|
|
|
|
|
|
table.insert(item_table, {
|
|
|
|
|
text = "Switch zoom mode",
|
|
|
|
|
text = "Screen rotate",
|
|
|
|
|
sub_item_table = {
|
|
|
|
|
{
|
|
|
|
|
text = "Zoom to fit content width",
|
|
|
|
|
text = "rotate 90 degree clockwise",
|
|
|
|
|
callback = function()
|
|
|
|
|
Screen:screenRotate("clockwise")
|
|
|
|
|
self.ui:handleEvent(Event:new("SetDimensions", Screen:getSize()))
|
|
|
|
|
end
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = "Zoom to fit content height",
|
|
|
|
|
text = "rotate 90 degree anticlockwise",
|
|
|
|
|
callback = function()
|
|
|
|
|
Screen:screenRotate("anticlockwise")
|
|
|
|
|
self.ui:handleEvent(Event:new("SetDimensions", Screen:getSize()))
|
|
|
|
|
end
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if self.ui.document.info.has_pages then
|
|
|
|
|
table.insert(item_table, {
|
|
|
|
|
text = "Switch zoom mode",
|
|
|
|
|
sub_item_table = {
|
|
|
|
|
{
|
|
|
|
|
text = "Zoom to fit content width",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = "Zoom to fit content height",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
else
|
|
|
|
|
table.insert(item_table, {
|
|
|
|
|
text = "Font menu",
|
|
|
|
|
callback = function()
|
|
|
|
|
self.ui:handleEvent(Event:new("ShowFontMenu"))
|
|
|
|
|
end
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
table.insert(item_table, {
|
|
|
|
|
text = "Return to file browser"
|
|
|
|
|
})
|
|
|
|
@ -30,6 +59,12 @@ function ReaderMenu:onShowMenu()
|
|
|
|
|
height = #item_table + 3 * 28
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function main_menu:onMenuChoice(item)
|
|
|
|
|
if item.callback then
|
|
|
|
|
item.callback()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
UIManager:show(main_menu)
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|