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
3.2 KiB
3.2 KiB
Reader Menu Improvements
Task
Overhaul the EPUB reader menu: consolidate dictionary actions behind long-press, add portrait/landscape toggle with preferred-orientation settings, add font size cycling, and rename several menu labels.
Changes Made
1. Consolidated Dictionary Menu Items
- Removed "Lookup Word History" and "Delete Dictionary Cache" from the reader menu
- Long-pressing Confirm on "Lookup Word" now opens the Lookup History screen
- "Delete Dictionary Cache" moved to a sentinel entry at the bottom of the Lookup History word list
Files: EpubReaderMenuActivity.h, EpubReaderMenuActivity.cpp, LookedUpWordsActivity.h, LookedUpWordsActivity.cpp, EpubReaderActivity.cpp
2. Toggle Portrait/Landscape
- Renamed "Reading Orientation" to "Toggle Portrait/Landscape" in the reader menu (kept the original name in global Settings)
- Short-press now toggles between preferred portrait and preferred landscape orientations
- Long-press opens a popup sub-menu with all 4 orientation options
- Added
preferredPortraitandpreferredLandscapesettings toCrossPointSettings(serialized at end for backward-compat) - Added corresponding settings to
SettingsList.husingDynamicEnum(maps non-sequential enum values correctly)
Files: CrossPointSettings.h, CrossPointSettings.cpp, SettingsList.h, EpubReaderMenuActivity.h, EpubReaderMenuActivity.cpp
3. Toggle Font Size
- Added new
TOGGLE_FONT_SIZEmenu action - Cycles through Small → Medium → Large → Extra Large → Small on each press
- Shows current size value next to the label (like orientation)
- Applied on menu exit via extended
onBackcallback(uint8_t orientation, uint8_t fontSize) - Added
applyFontSize()toEpubReaderActivity(saves to settings, resets section for re-layout)
Files: EpubReaderMenuActivity.h, EpubReaderMenuActivity.cpp, EpubReaderActivity.h, EpubReaderActivity.cpp
4. Label Renames
- "Letterbox Fill" → "Override Letterbox Fill" (reader menu only; global setting keeps original name)
- "Sync Progress" → "Sync Reading Progress"
Files: english.yaml (I18n source), regenerated I18nKeys.h, I18nStrings.h, I18nStrings.cpp
5. Long-Press Safety
- Added
ignoreNextConfirmReleaseflag toEpubReaderMenuActivityto prevent stale releases - Added
initialSkipReleaseconstructor parameter toLookedUpWordsActivity - Extended
ignoreNextConfirmReleaseguard to cover the word-selection path (not just delete-confirm mode) - Orientation sub-menu also uses
ignoreNextConfirmReleaseto avoid selecting on long-press release
6. New I18n Strings
STR_TOGGLE_ORIENTATION: "Toggle Portrait/Landscape"STR_TOGGLE_FONT_SIZE: "Toggle Font Size"STR_OVERRIDE_LETTERBOX_FILL: "Override Letterbox Fill"STR_PREFERRED_PORTRAIT: "Preferred Portrait"STR_PREFERRED_LANDSCAPE: "Preferred Landscape"
Build Status
Successfully compiled (default environment). RAM: 31.1%, Flash: 99.4%.
Follow-up Items
- Translations: New strings fall back to English for all non-English languages. Translators can add entries to their respective YAML files.
- The
SettingInfo::Enumapproach doesn't work for non-sequential enum values (portrait=0, inverted=2). UsedDynamicEnumwith getter/setter lambdas instead.