[fix] Allow closing SortWidget (#6464)

For now, close on any keypress.

Cf. https://github.com/koreader/koreader/issues/6463
reviewable/pr6470/r1
Frans de Jonge 4 years ago committed by GitHub
parent 2d8c50708f
commit 49a5aa179b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -168,6 +168,13 @@ function SortWidget:init()
w = self.width or Screen:getWidth(),
h = self.height or Screen:getHeight(),
}
if Device:hasKeys() then
self.key_events = {
--don't get locked in on non touch devices
AnyKeyPressed = { { Device.input.group.Any },
seqtext = "any key", doc = "close dialog" }
}
end
if Device:isTouchDevice() then
self.ges_events.Swipe = {
GestureRange:new{
@ -455,6 +462,10 @@ function SortWidget:swapItems(pos1, pos2)
end
end
function SortWidget:onAnyKeyPressed()
return self:onClose()
end
function SortWidget:onNextPage()
self:nextPage()
return true

Loading…
Cancel
Save