Brings ~55 mod-exclusive files to the upstream-based mod/master-resync branch: Activities (migrated to new ActivityManager pattern): - Clock/Time: SetTimeActivity, SetTimezoneOffsetActivity, NtpSyncActivity - Dictionary: DictionaryDefinitionActivity, DictionarySuggestionsActivity, DictionaryWordSelectActivity, LookedUpWordsActivity - Bookmark: EpubReaderBookmarkSelectionActivity - Book management: BookManageMenuActivity, EndOfBookMenuActivity - OPDS: OpdsServerListActivity, OpdsSettingsActivity - Utility: DirectoryPickerActivity, NumericStepperActivity Utilities (unchanged): - BookManager, BookSettings, BookmarkStore, BootNtpSync - Dictionary, LookupHistory, TimeSync, OpdsServerStore Libraries: PlaceholderCover, TableData, ChapterXPathIndexer Scripts: inject_mod_version, generate_book_icon, preview_placeholder_cover Docs: KOReader sync XPath mapping Migration changes: - ActivityWithSubactivity -> Activity base class - Callback constructors -> finish()/setResult() pattern - enterNewActivity() -> startActivityForResult() - Activity::RenderLock&& -> RenderLock&& These files won't compile yet - they reference mod settings and I18n strings that will be added in subsequent phases. Made-with: Cursor
2.8 KiB
2.8 KiB
Per-book Letterbox Fill Override
Date: 2026-02-13 Branch: mod/fix-edge-fills
Task
Add the ability to override the sleep cover "letterbox fill mode" on a per-book basis (EPUB only for the menu UI; all book types respected at sleep time).
Changes Made
New files
src/util/BookSettings.h/src/util/BookSettings.cpp— Lightweight per-book settings utility. Stores aletterboxFillOverridefield (0xFF = use global default) in{cachePath}/book_settings.bin. Versioned binary format with field count for forward compatibility, matching the pattern used by BookmarkStore and CrossPointSettings.
Modified files
src/activities/reader/EpubReaderMenuActivity.h— AddedLETTERBOX_FILLto theMenuActionenum. AddedbookCachePath,pendingLetterboxFill, letterbox fill labels, and helper methods (letterboxFillToIndex,indexToLetterboxFill,saveLetterboxFill). Constructor now accepts abookCachePathparameter and loads the current per-book settings.src/activities/reader/EpubReaderMenuActivity.cpp— HandleLETTERBOX_FILLaction: cycles through Default/Dithered/Solid/None on Confirm (handled locally likeROTATE_SCREEN), saves immediately. Renders the current value on the right side of the menu item.src/activities/reader/EpubReaderActivity.cpp— Passesepub->getCachePath()to the menu activity constructor. AddedROTATE_SCREENandLETTERBOX_FILLto theonReaderMenuConfirmswitch as no-ops to prevent compiler warnings.src/activities/boot_sleep/SleepActivity.h— AddedfillModeOverrideparameter torenderBitmapSleepScreen().src/activities/boot_sleep/SleepActivity.cpp—renderCoverSleepScreen()now loadsBookSettingsfrom the book's cache path after determining the book type. Passes the per-book override torenderBitmapSleepScreen().renderBitmapSleepScreen()uses the override if valid, otherwise falls back to the globalSETTINGS.sleepScreenLetterboxFill.
How It Works
- User opens the EPUB reader menu (Confirm button while reading).
- "Letterbox Fill" appears between "Reading Orientation" and "Table of Contents".
- Pressing Confirm cycles: Default → Dithered → Solid → None → Default...
- The selection is persisted immediately to
book_settings.binin the book's cache directory. - When the device enters sleep with the cover screen, the per-book override is loaded and used instead of the global setting (if set).
- XTC and TXT books also have their per-book override checked at sleep time, but can only be configured for EPUB via the reader menu (XTC/TXT lack general menus).
Follow-up Items
- Consider adding the letterbox fill override to XTC/TXT reader menus if those get general menus in the future.
- The
BookSettingsstruct is extensible — other per-book overrides can be added by appending fields and incrementingBOOK_SETTINGS_COUNT.