From a185290549d043a35cd95ad1ea6000ea7e3ee7bd Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Fri, 9 Apr 2021 19:38:17 +0200 Subject: [PATCH] FileManagerHistory: Handle rotation events Fix #7518 --- frontend/apps/filemanager/filemanagerhistory.lua | 12 ++++++++++++ reader.lua | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/apps/filemanager/filemanagerhistory.lua b/frontend/apps/filemanager/filemanagerhistory.lua index 989d3c7ce..b4faf784b 100644 --- a/frontend/apps/filemanager/filemanagerhistory.lua +++ b/frontend/apps/filemanager/filemanagerhistory.lua @@ -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 diff --git a/reader.lua b/reader.lua index 35e56427c..0f97da2bb 100755 --- a/reader.lua +++ b/reader.lua @@ -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")