2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00

TextViewer: allow close on any multiswipe (#9720)

Similar to most fullscreen widgets.
This commit is contained in:
poire-z 2022-10-31 23:15:42 +01:00 committed by GitHub
parent 42d4056f8f
commit f10ea7d339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,16 @@ function TextViewer:init()
}
},
},
MultiSwipe = {
GestureRange:new{
ges = "multiswipe",
range = Geom:new{
x = 0, y = 0,
w = Screen:getWidth(),
h = Screen:getHeight(),
}
},
},
}
end
@ -294,6 +304,14 @@ function TextViewer:onTapClose(arg, ges_ev)
return true
end
function TextViewer:onMultiSwipe(arg, ges_ev)
-- For consistency with other fullscreen widgets where swipe south can't be
-- used to close and where we then allow any multiswipe to close, allow any
-- multiswipe to close this widget too.
self:onClose()
return true
end
function TextViewer:onClose()
UIManager:close(self)
if self.close_callback then