Fix diagonal refresh not working in TOC and History

By delegating diagonal swipe handling to GestureManager only
when the Menu or FileChooser instance is the FileManager one.
This commit is contained in:
poire-z
2018-12-05 12:56:54 +01:00
parent a2e7e62be7
commit ed8f87f9f4
2 changed files with 5 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ function FileManager:init()
local g_show_hidden = G_reader_settings:readSetting("show_hidden")
local show_hidden = g_show_hidden == nil and DSHOWHIDDENFILES or g_show_hidden
local file_chooser = FileChooser:new{
-- remeber to adjust the height when new item is added to the group
-- remember to adjust the height when new item is added to the group
path = self.root_path,
focused_path = self.focused_file,
collate = G_reader_settings:readSetting("collate") or "strcoll",
@@ -150,6 +150,8 @@ function FileManager:init()
close_callback = function() return self:onClose() end,
-- allow left bottom tap gesture, otherwise it is eaten by hidden return button
return_arrow_propagation = true,
-- allow Menu widget to delegate handling of some gestures to GestureManager
is_file_manager = true,
}
self.file_chooser = file_chooser
self.focused_file = nil -- use it only once

View File

@@ -1191,7 +1191,8 @@ function Menu:onSwipe(arg, ges_ev)
-- no use for now
do end -- luacheck: ignore 541
else -- diagonal swipe
if G_reader_settings:readSetting("gesture_fm") and G_reader_settings:readSetting("gesture_fm")["short_diagonal_swipe"] then
if self.is_file_manager and G_reader_settings:readSetting("gesture_fm") and
G_reader_settings:readSetting("gesture_fm")["short_diagonal_swipe"] then
-- managed by gesture manager
do end -- luacheck: ignore 541
else