2
0
mirror of https://github.com/koreader/koreader synced 2024-11-16 06:12:56 +00:00
koreader/frontend/ui/elements/menu_activate.lua
2017-08-08 18:45:14 +02:00

62 lines
1.9 KiB
Lua

local InfoMessage = require("ui/widget/infomessage")
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local function activateMenu() return G_reader_settings:readSetting("activate_menu") end
return {
text = _("Activate menu"),
sub_item_table = {
{
text = _("Swipe and tap"),
checked_func = function()
local activate_menu = activateMenu()
if activate_menu == nil or activate_menu == "swipe_tap" then
return true
else
return false
end
end,
callback = function()
G_reader_settings:saveSetting("activate_menu", "swipe_tap")
UIManager:show(InfoMessage:new{
text = _("This will take effect on next restart."),
})
end
},
{
text = _("Only swipe"),
checked_func = function()
if activateMenu() == "swipe" then
return true
else
return false
end
end,
callback = function()
G_reader_settings:saveSetting("activate_menu", "swipe")
UIManager:show(InfoMessage:new{
text = _("This will take effect on next restart."),
})
end
},
{
text = _("Only tap"),
checked_func = function()
if activateMenu() == "tap" then
return true
else
return false
end
end,
callback = function()
G_reader_settings:saveSetting("activate_menu", "tap")
UIManager:show(InfoMessage:new{
text = _("This will take effect on next restart."),
})
end
},
}
}