Add ReaderHandmade: support for custom TOC and hidden flows

Checkboxes under TOC>Settings> allow enabling Custom TOC
and Custom hidden flows (similar to "Hide non-linear fragments"
available with some EPUBs).
Handled by a new ReaderHandmade module.
Adding and removing TOC chapters is done in PageBrowser
with long-press on a page thumbnail, and for chapters also
in the popup dialog after selecting some text in a page.

ReaderToc: add a symbol in title when the TOC is the
alternative TOC or the custom TOC.
This commit is contained in:
poire-z
2023-10-08 17:51:56 +02:00
parent c51b0c7bb9
commit ea3f8951a3
8 changed files with 858 additions and 18 deletions

View File

@@ -466,7 +466,9 @@ function ReaderRolling:addToMainMenu(menu_items)
menu_items.hide_nonlinear_flows = {
text = _("Hide non-linear fragments"),
enabled_func = function()
-- Custom hidden flows have precedence over publisher hidden non-linear fragments
return self.view.view_mode == "page" and self.ui.document:getVisiblePageCount() == 1
and not self.ui.handmade:isHandmadeHiddenFlowsEnabled()
end,
checked_func = function() return self.hide_nonlinear_flows end,
callback = function()