From ce727e77366747388e92ca932ed6ce721683fbe8 Mon Sep 17 00:00:00 2001 From: Zhiqi Yao Date: Sun, 7 Jun 2026 03:18:10 +0800 Subject: [PATCH] Screen rotation: always show rotation mode options in file browser (#15505) Previously rotation mode options were gated behind FileManager.instance, which becomes nil when the Reader is opened (ReaderUI:doShowReader explicitly closes the FileManager). This made manual rotation inaccessible from the Reader view on all platforms, especially noticeable on Android where hasGSensor is false and the menu otherwise offers no way to change orientation. Original reasoning from : > Before this PR we were always setting a screenmode and the checking what rotation to use, now we set rotations, and let koreader figure out what is the screenmode. (besides for the FM, which does not support landscape) now the only thing setting a screenmode is the FM. > > This separates the rotation (physical) from the screenmode (portrait/landscape or H>W/W>H). I did not get into why the FM has to be portrait but if someone fixes that then the rotation and screenmode will be totally independent. --- frontend/ui/elements/screen_rotation_menu_table.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/ui/elements/screen_rotation_menu_table.lua b/frontend/ui/elements/screen_rotation_menu_table.lua index 678523729..9140f03d9 100644 --- a/frontend/ui/elements/screen_rotation_menu_table.lua +++ b/frontend/ui/elements/screen_rotation_menu_table.lua @@ -1,6 +1,5 @@ local Device = require("device") local Event = require("ui/event") -local FileManager = require("apps/filemanager/filemanager") local UIManager = require("ui/uimanager") local _ = require("gettext") local Screen = Device.screen @@ -77,11 +76,9 @@ When unchecked, the default rotation of the file browser and the default/saved r separator = true, }) - if FileManager.instance then - 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 + 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 rotation_table[#rotation_table].separator = true