mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix, UX] Gesture manager: fix "Toggle rotation" action (#4740)
By using the same events used by the bottom menu toggles. Reference #4724 (comment). Close #4738.
This commit is contained in:
@@ -692,11 +692,9 @@ function ReaderGesture:gestureAction(action, ges)
|
||||
self.ui:handleEvent(Event:new("RestoreZoomMode"))
|
||||
self.ui:handleEvent(Event:new("InitScrollPageStates"))
|
||||
elseif action == "toggle_rotation" then
|
||||
if Screen:getScreenMode() == "portrait" then
|
||||
self.ui:handleEvent(Event:new("SetScreenMode", "landscape"))
|
||||
else
|
||||
self.ui:handleEvent(Event:new("SetScreenMode", "portrait"))
|
||||
end
|
||||
local event_name = self.document.info.has_pages and "SwapScreenMode" or "ChangeScreenMode"
|
||||
local arg = Screen:getScreenMode() == "portrait" and "landscape" or "portrait"
|
||||
self.ui:handleEvent(Event:new(event_name, arg))
|
||||
elseif action == "suspend" then
|
||||
UIManager:suspend()
|
||||
elseif action == "exit" then
|
||||
|
||||
Reference in New Issue
Block a user