Menu widget: rotation handler (#12573)

This commit is contained in:
hius07
2024-10-10 10:54:59 +03:00
committed by GitHub
parent 89b9300a70
commit 76deedfb73
4 changed files with 22 additions and 54 deletions

View File

@@ -1272,6 +1272,20 @@ function Menu:onScreenResize(dimen)
return false
end
function Menu:onSetRotationMode(rotation)
if self._recreate_func and rotation ~= nil and rotation ~= Screen:getRotationMode() then
UIManager:close(self)
-- Also re-layout ReaderView or FileManager itself
if self._manager.ui.view then
self._manager.ui.view:onSetRotationMode(rotation)
else
self._manager.ui:onSetRotationMode(rotation)
end
self._recreate_func()
return true
end
end
function Menu:onSelectByShortCut(_, keyevent)
for k,v in ipairs(self.item_shortcuts) do
if k > self.perpage then