mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
TouchMenu: don't allow swipe south to close menu
This is mostly needed because opening the menu with swipe is actually done by handling a pan south event, and so the final swipe event is another event, that is then handled by TouchMenu, which would straight away close itself.
This commit is contained in:
@@ -756,7 +756,7 @@ function TouchMenu:switchMenuTab(tab_num)
|
||||
self:updateItems()
|
||||
end
|
||||
|
||||
function TouchMenu:backToUpperMenu()
|
||||
function TouchMenu:backToUpperMenu(no_close)
|
||||
if #self.item_table_stack ~= 0 then
|
||||
self.item_table = table.remove(self.item_table_stack)
|
||||
self.page = 1
|
||||
@@ -771,7 +771,7 @@ function TouchMenu:backToUpperMenu()
|
||||
self.parent_id = nil
|
||||
end
|
||||
self:updateItems()
|
||||
else
|
||||
elseif not no_close then
|
||||
self:closeMenu()
|
||||
end
|
||||
end
|
||||
@@ -821,7 +821,10 @@ function TouchMenu:onSwipe(arg, ges_ev)
|
||||
elseif direction == "north" then
|
||||
self:closeMenu()
|
||||
elseif direction == "south" then
|
||||
self:onBack()
|
||||
-- We don't allow the menu to be closed (this is also necessary as
|
||||
-- a swipe south will be emitted when done opening the menu with
|
||||
-- swipe, as the event handled for that is pan south).
|
||||
self:backToUpperMenu(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user