PR #1311: Replace separate spaceWidth + getSpaceKernAdjust() with a single getSpaceAdvance() that combines space glyph advance and kerning in fixed-point before snapping to pixels, eliminating +/-1 px rounding drift in text layout. PR #1322: Add early exit to fillUncompressedSizes() once all target entries are matched, avoiding unnecessary central directory traversal. Also updates tracking docs and verifies PR #1329 (reader utils refactor) matches upstream after merge. Made-with: Cursor
1.7 KiB
1.7 KiB
Restore Preferred Orientation Settings and Long-Press Sub-Menu
Date: 2026-03-08
Branch: mod/master
Commit: 0d8a3fd
Task
Restore two orientation preference features lost during the upstream PR resync:
- Settings UI entries for preferred portrait/landscape modes
- Long-press sub-menu on the reader menu's orientation toggle
Changes
Settings UI and Persistence
src/SettingsList.h: AddedDynamicEnumentries forpreferredPortrait(Portrait/Inverted) andpreferredLandscape(Landscape CW/Landscape CCW) in the Reader settings category. Uses getter/setter lambdas to map between sequential indices and non-sequential orientation enum values.src/JsonSettingsIO.cpp: Added manual JSON save/load for both fields with validation (rejects invalid orientation values, falls back to defaults).
Long-Press Orientation Sub-Menu
src/activities/reader/EpubReaderMenuActivity.h: AddedorientationSubMenuOpen,orientationSubMenuIndex, andignoreNextConfirmReleasestate flags.src/activities/reader/EpubReaderMenuActivity.cpp:loop(): Long-press (700ms) on Confirm when the orientation item is selected opens the sub-menu. Sub-menu handles its own Up/Down/Confirm/Back input. AddedignoreNextConfirmReleaseguard to prevent the long-press release from immediately selecting.render(): When sub-menu is open, renders a centered list of all 4 orientations with the current one marked with*. Uses the same gutter/hint layout as the main menu.
Follow-up
- Hardware testing needed for both features
- Translations for
STR_PREFERRED_PORTRAITandSTR_PREFERRED_LANDSCAPEonly exist in English; other languages fall back automatically