Menu search fixes (#13493)

This commit is contained in:
hius07
2025-04-01 09:33:48 +03:00
committed by GitHub
parent 2a10f7188b
commit 25101d2bb5
3 changed files with 51 additions and 35 deletions

View File

@@ -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