Touch menu: always go up to correct parent page (#12378)

This commit is contained in:
hius07
2024-08-21 20:53:45 +03:00
committed by GitHub
parent 698fc35c3f
commit 415ce40f84
4 changed files with 1 additions and 7 deletions

View File

@@ -1684,11 +1684,6 @@ With this feature enabled, the current page is factored in, resulting in the cou
end, end,
}) })
end end
-- Settings menu: keep the same parent page for going up from submenu
for i = 1, #configure_items_sub_table do
configure_items_sub_table[i].menu_item_id = i
end
end end
-- settings menu item generators -- settings menu item generators

View File

@@ -902,7 +902,6 @@ function Dispatcher:_addItem(caller, menu, location, settings, section)
end end
end, end,
separator = settingsList[k].separator, separator = settingsList[k].separator,
menu_item_id = k,
}) })
end end
end end

View File

@@ -928,6 +928,7 @@ function TouchMenu:onMenuSelect(item, tap_on_checkmark)
end end
else else
table.insert(self.item_table_stack, self.item_table) table.insert(self.item_table_stack, self.item_table)
item.menu_item_id = item.menu_item_id or tostring(item) -- unique id
self.parent_id = item.menu_item_id self.parent_id = item.menu_item_id
self.item_table = sub_item_table self.item_table = sub_item_table
self.page = 1 self.page = 1

View File

@@ -310,7 +310,6 @@ function Gestures:genSubItem(ges, separator, hold_callback)
sub_item_table_func = function() return self:genMenu(ges) end, sub_item_table_func = function() return self:genMenu(ges) end,
separator = separator, separator = separator,
hold_callback = hold_callback, hold_callback = hold_callback,
menu_item_id = ges,
ignored_by_menu_search = true, -- This item is not strictly duplicated, but its subitems are. ignored_by_menu_search = true, -- This item is not strictly duplicated, but its subitems are.
-- Ignoring it speeds up search. -- Ignoring it speeds up search.
} }