[fix] Allow closing SortWidget (#6464)
For now, close on any keypress. Cf. https://github.com/koreader/koreader/issues/6463
This commit is contained in:
1 parent
2d8c50708f
commit
49a5aa179b
1 file changed
+11
@@ -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
|
||||
|
||||
Reference in new issue
Block a user