Files
koreader/frontend/ui/elements/platform_navigation.lua
NiLuJe 6283674c47 Menu: Split off "Page Turns" submenu in two sections
The Kindle swipe animations & physical key inversion apply *everywhere*,
so we need this accessible in the FM, too.

Move it to Navigation, which is where it already was on !Touch devices.
2023-08-15 21:24:11 +02:00

42 lines
1.1 KiB
Lua

local Device = require("device")
local Event = require("ui/event")
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local PlatformNav = {
text = _("Page turn behavior"), -- Mainly so as to differentiate w/ "Page Turns" when in readermenu...
sub_item_table = {},
}
if Device:canDoSwipeAnimation() then
table.insert(PlatformNav.sub_item_table, {
text =_("Page turn animations"),
checked_func = function()
return G_reader_settings:isTrue("swipe_animations")
end,
callback = function()
UIManager:broadcastEvent(Event:new("TogglePageChangeAnimation"))
end,
separator = true,
})
end
if Device:hasKeys() then
table.insert(PlatformNav.sub_item_table, {
text = _("Invert page turn buttons"),
checked_func = function()
return G_reader_settings:isTrue("input_invert_page_turn_keys")
end,
callback = function()
UIManager:broadcastEvent(Event:new("SwapPageTurnButtons"))
end,
})
end
-- No menu item at all if it's empty
if #PlatformNav.sub_item_table == 0 then
return {}
end
return PlatformNav