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 <https://github.com/koreader/koreader/pull/6309>: > 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.
This commit is contained in:
1 parent
fa6b3cde8f
commit
ce727e7736
1 file changed
+3
-6
@@ -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
|
||||
|
||||
Reference in new issue
Block a user