mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
BookMap: add "Overview" mode
Add a restricted but convenient mode showing BookMap like in initial view, while still allowing chapter levels to be tweaked. This allows getting back to this view with another gesture to see the overall progress in the book, while still having the normal BookMap in flat mode acting as an alternative ToC. Available as an action to associate to a gesture, and with long-press on the "Book map" menu item.
This commit is contained in:
@@ -68,6 +68,12 @@ function ReaderThumbnail:addToMainMenu(menu_items)
|
||||
callback = function()
|
||||
self:onShowBookMap()
|
||||
end,
|
||||
-- Show the alternative overview mode (which is just a restricted
|
||||
-- variation of the main book map) with long-press (let's avoid
|
||||
-- adding another item in the crowded first menu).
|
||||
hold_callback = function()
|
||||
self:onShowBookMap(true)
|
||||
end,
|
||||
}
|
||||
menu_items.page_browser = {
|
||||
text = _("Page browser"),
|
||||
@@ -77,10 +83,11 @@ function ReaderThumbnail:addToMainMenu(menu_items)
|
||||
}
|
||||
end
|
||||
|
||||
function ReaderThumbnail:onShowBookMap()
|
||||
function ReaderThumbnail:onShowBookMap(overview_mode)
|
||||
local BookMapWidget = require("ui/widget/bookmapwidget")
|
||||
UIManager:show(BookMapWidget:new{
|
||||
ui = self.ui,
|
||||
overview_mode = overview_mode,
|
||||
})
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user