mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] Allow closing SortWidget (#6464)
For now, close on any keypress. Cf. https://github.com/koreader/koreader/issues/6463
This commit is contained in:
@@ -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