as first discussed here #11908. This PR brings the book map to non-touch devices that useDPadAsActionKeys().
Book map can be accessed from the menu or by using the following shortcut: ScreenKB + Down or Shift + Down depending on whether you use a K4 device or a kindle with keyboard respectively.
Inside the book map, a user can toggle the hamburger menu by pressing the Menu key and make any adjustment from there. ScreenKB (or Shift) + Up/Down allows it to scroll and Page turn buttons to move by whole full page turns. Back key allows user to exit the map.
self:toggleDefaultSettings()-- toggle between user settings and default view
end,
@ -1181,7 +1188,7 @@ function BookMapWidget:update()
end
functionBookMapWidget:showMenu()
functionBookMapWidget:onShowBookMapMenu()
localbutton_dialog
-- Width of our -/+ buttons, so it looks fine with Button's default font size of 20
localplus_minus_width=Screen:scaleBySize(60)
@ -1223,7 +1230,7 @@ function BookMapWidget:showMenu()
end,
}},
notself.overview_modeand{{
text=_("Switch current/initial views"),
text=_("Switch current/initial view"),
align="left",
enabled_func=function()returnself.toc_depth>0end,
callback=function()
@ -1269,7 +1276,7 @@ function BookMapWidget:showMenu()
},
notself.overview_modeand{
{
text=_("Pageslot width"),
text=_("Page-slot width"),
callback=function()end,
align="left",
-- Below, minus increases page per row and plus decreases it.
@ -1324,6 +1331,10 @@ function BookMapWidget:showMenu()
}
},
}
-- remove "Page browser on tap" from non-touch devices
ifnotDevice:isTouchDevice()then
table.remove(buttons,3)
end
-- Remove false buttons from the list if overview_mode
fori=#buttons,1,-1do
ifnotbuttons[i]then
@ -1341,13 +1352,12 @@ function BookMapWidget:showMenu()
}
UIManager:show(button_dialog)
end
functionBookMapWidget:showAbout()
localtext=_([[
Bookmapdisplays anoverviewofthebookcontent.
Bookmapprovides asummaryofabook's content, showing chapters and pages visually. If statistics are enabled, black bars represent pages already read (gray for pages read in the current session), with varying heights based on reading time.
@ -1357,17 +1367,24 @@ Under the pages, these indicators may be shown:
ifself.overview_modethen
text=text.."\n\n".._([[
In overviewmode,thebookmapisalwaysingridmodeandmadetofitonasinglescreen.Chapterlevelscanbechangedforthemostcomfortableoverview.]])
When in overviewmode,thebookmapisalwaysdisplayedingridmodetofitononescreen.Thechapterlevelscanbeeasilyadjustedforthemostconvenientoverviewexperience.]])
else
text=text.."\n\n".._([[
On anewlyopenedbook,thebookmapwillstartingridmodeshowingallchapterlevels,fittingonasinglescreen,togivethebestinitialoverviewofthebook's content.]])
When youfirstopenabook,thebookmapwillbeginingridmode,displayingallchapterlevelsononescreenforacomprehensiveoverviewofthebook's content.]])