FileManagerHistory: Handle rotation events

Fix #7518
This commit is contained in:
NiLuJe
2021-04-09 19:38:17 +02:00
parent 5f9f7ce1da
commit a185290549
2 changed files with 13 additions and 1 deletions

View File

@@ -134,6 +134,18 @@ function FileManagerHistory:onShowHist()
onMenuHold = self.onMenuHold,
_manager = self,
}
-- Handle rotation events
local this = self
function self.hist_menu:onSetRotationMode(rotation)
if rotation ~= nil and rotation ~= Screen:getRotationMode() then
UIManager:close(this.hist_menu)
Screen:setRotationMode(rotation)
this:onShowHist()
end
return true
end
self:updateItemTable()
self.hist_menu.close_callback = function()
-- Close it at next tick so it stays displayed

View File

@@ -300,7 +300,7 @@ else
if start_with == "history" then
local FileManagerHistory = require("apps/filemanager/filemanagerhistory")
UIManager:nextTick(function()
FileManagerHistory:onShowHist(last_file)
FileManagerHistory:onShowHist()
end)
elseif start_with == "favorites" then
local FileManagerCollection = require("apps/filemanager/filemanagercollection")