2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00
koreader/frontend/ui/elements/menu_activate.lua

47 lines
1.6 KiB
Lua
Raw Normal View History

2017-08-08 16:20:46 +00:00
local UIManager = require("ui/uimanager")
local _ = require("gettext")
return {
text = _("Activate menu"),
sub_item_table = {
{
text = _("With a tap"),
2017-08-08 16:20:46 +00:00
checked_func = function()
return G_reader_settings:readSetting("activate_menu") ~= "swipe"
2017-08-08 16:20:46 +00:00
end,
callback = function()
if G_reader_settings:readSetting("activate_menu") ~= "swipe" then
G_reader_settings:saveSetting("activate_menu", "swipe")
2017-08-08 16:20:46 +00:00
else
G_reader_settings:saveSetting("activate_menu", "swipe_tap")
2017-08-08 16:20:46 +00:00
end
UIManager:askForRestart()
end,
2017-08-08 16:20:46 +00:00
},
{
text = _("With a swipe"),
2017-08-08 16:20:46 +00:00
checked_func = function()
return G_reader_settings:readSetting("activate_menu") ~= "tap"
2017-08-08 16:20:46 +00:00
end,
callback = function()
if G_reader_settings:readSetting("activate_menu") ~= "tap" then
G_reader_settings:saveSetting("activate_menu", "tap")
else
G_reader_settings:saveSetting("activate_menu", "swipe_tap")
end
UIManager:askForRestart()
end,
separator = true,
},
{
text = _("Auto-show bottom menu"),
checked_func = function()
return G_reader_settings:nilOrTrue("show_bottom_menu")
end,
callback = function()
G_reader_settings:flipNilOrTrue("show_bottom_menu")
end,
2017-08-08 16:20:46 +00:00
},
}
}