[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.
pull/4741/head
poire-z 5 years ago committed by Frans de Jonge
parent 29f52cce81
commit addd06c1de

@ -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

Loading…
Cancel
Save