mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Menu search fixes (#13493)
This commit is contained in:
@@ -381,15 +381,11 @@ function ReaderMenu:exitOrRestart(callback, force)
|
||||
end)
|
||||
end
|
||||
|
||||
function ReaderMenu:onShowMenu(tab_index)
|
||||
function ReaderMenu:onShowMenu(tab_index, do_not_show)
|
||||
if self.tab_item_table == nil then
|
||||
self:setUpdateItemTable()
|
||||
end
|
||||
|
||||
if not tab_index then
|
||||
tab_index = self.last_tab_index
|
||||
end
|
||||
|
||||
local menu_container = CenterContainer:new{
|
||||
covers_header = true,
|
||||
ignore = "height",
|
||||
@@ -401,9 +397,10 @@ function ReaderMenu:onShowMenu(tab_index)
|
||||
local TouchMenu = require("ui/widget/touchmenu")
|
||||
main_menu = TouchMenu:new{
|
||||
width = Screen:getWidth(),
|
||||
last_index = tab_index,
|
||||
last_index = tab_index or self.last_tab_index,
|
||||
tab_item_table = self.tab_item_table,
|
||||
show_parent = menu_container,
|
||||
not_shown = do_not_show,
|
||||
}
|
||||
else
|
||||
local Menu = require("ui/widget/menu")
|
||||
@@ -426,7 +423,9 @@ function ReaderMenu:onShowMenu(tab_index)
|
||||
menu_container[1] = main_menu
|
||||
-- maintain a reference to menu_container
|
||||
self.menu_container = menu_container
|
||||
UIManager:show(menu_container)
|
||||
if not do_not_show then
|
||||
UIManager:show(menu_container)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -512,7 +511,7 @@ function ReaderMenu:onSaveSettings()
|
||||
end
|
||||
|
||||
function ReaderMenu:onMenuSearch()
|
||||
self:onShowMenu()
|
||||
self:onShowMenu(nil, true)
|
||||
self.menu_container[1]:onShowMenuSearch()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user