Profiles: add "on rotation" auto-execute event (#12612)

This commit is contained in:
hius07
2024-10-10 18:05:24 +03:00
committed by GitHub
parent 76deedfb73
commit 85591c75ce
5 changed files with 112 additions and 16 deletions

View File

@@ -3,7 +3,6 @@ local Event = require("ui/event")
local FileManager = require("apps/filemanager/filemanager")
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local C_ = _.pgettext
local Screen = Device.screen
local function genMenuItem(text, mode)
@@ -78,10 +77,10 @@ When unchecked, the default rotation of the file browser and the default/saved r
})
if FileManager.instance then
table.insert(rotation_table, genMenuItem(C_("Rotation", "⤹ 90°"), Screen.DEVICE_ROTATED_COUNTER_CLOCKWISE))
table.insert(rotation_table, genMenuItem(C_("Rotation", "↑ 0°"), Screen.DEVICE_ROTATED_UPRIGHT))
table.insert(rotation_table, genMenuItem(C_("Rotation", "⤸ 90°"), Screen.DEVICE_ROTATED_CLOCKWISE))
table.insert(rotation_table, genMenuItem(C_("Rotation", "↓ 180°"), Screen.DEVICE_ROTATED_UPSIDE_DOWN))
local optionsutil = require("ui/data/optionsutil")
for i, mode in ipairs(optionsutil.rotation_modes) do
table.insert(rotation_table, genMenuItem(optionsutil.rotation_labels[i], mode))
end
end
rotation_table[#rotation_table].separator = true