Font list menu: allow sorting by more recently set (#10662)

- Add a toggle in Font settings> allowing showing font
  ordered by most recently selected (long-press on
  it allows clearing this history).
- Keep in G_reader_settings a list of known fonts, so
  we can notice newly added user fonts, and put them
  at the start of the most recently selected. Show
  these new fonts with a symbol in the menu.
- TouchMenu: allows for a flag to trigger menu
  refresh when going up.
This commit is contained in:
poire-z
2023-07-12 22:29:13 +02:00
committed by GitHub
parent c72b3dbae4
commit d0e705a582
2 changed files with 130 additions and 9 deletions

View File

@@ -798,6 +798,11 @@ end
function TouchMenu:backToUpperMenu(no_close)
if #self.item_table_stack ~= 0 then
self.item_table = table.remove(self.item_table_stack)
-- Allow a menu table to refresh itself when going up (ie. from a setting
-- submenu that may want to have its parent menu updated).
if self.item_table.needs_refresh and self.item_table.refresh_func then
self.item_table = self.item_table.refresh_func()
end
self.page = 1
if self.parent_id then
self:_recalculatePageLayout() -- we need an accurate self.perpage