mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Landscape FM / Refactor rotation (#6309)
* landscape FM / Refactor rotation refactor and simplify the orientation handling code. the user generally cares about the rotation (what direction the device is facing) and not about if koreader is displaying in portrait or landscape mode * bump base update luasocket, libjpeg-turbo, curl add logging to evernote-sdk-lua update framebuffer for proper rotation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local BD = require("ui/bidi")
|
||||
local bit = require("bit")
|
||||
local ConfirmBox = require("ui/widget/confirmbox")
|
||||
local DataStorage = require("datastorage")
|
||||
local Device = require("device")
|
||||
@@ -1551,9 +1552,8 @@ function ReaderGesture:gestureAction(action, ges)
|
||||
self.ui:handleEvent(Event:new("RestoreZoomMode"))
|
||||
self.ui:handleEvent(Event:new("InitScrollPageStates"))
|
||||
elseif action == "toggle_rotation" then
|
||||
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))
|
||||
local arg = bit.band((Screen:getRotationMode() + 1), 3)
|
||||
self.ui:handleEvent(Event:new("SetRotationMode", arg))
|
||||
elseif action == "toggle_wifi" then
|
||||
local NetworkMgr = require("ui/network/manager")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user