In landscape CW/CCW the physical buttons are on the left/right side, not the bottom. Reserve a horizontal gutter (sideButtonHintsWidth) on the appropriate side and remove the bottom buttonHintsHeight padding, following the established pattern from other activities. Made-with: Cursor
1.8 KiB
1.8 KiB
BookInfo: Landscape Button Hint Gutter Fix
Date: 2026-03-09 Task: Adjust BookInfo's content area and header placement in landscape orientations to account for button hints appearing on a side instead of the bottom.
Problem
In landscape orientations the physical front buttons end up on a side of the screen (CW = left, CCW = right). BookInfo was reserving buttonHintsHeight at the bottom in all orientations, wasting vertical space in landscape and not accounting for the side gutter needed to avoid overlapping the side-drawn button hints.
Changes Made
src/activities/home/BookInfoActivity.cpp
buildLayout(): AddedhintGutterWidthcomputation (metrics.sideButtonHintsWidthin landscape, 0 in portrait). Text wrapping width (contentW) now subtractshintGutterWidth. Bottom padding forcontentHeightuses onlyverticalSpacingin landscape (nobuttonHintsHeightsince there are no bottom hints).render(): AddedisLandscapeCw,hintGutterWidth, andcontentXcomputations following the established codebase pattern. In CW,contentX = hintGutterWidthshifts all content right (hints on left). In CCW,contentX = 0and content width is reduced (hints on right). Cover X position offset bycontentX. Field X offset bycontentX.contentBottomno longer subtractsbuttonHintsHeightin landscape. HeaderfillRectanddrawHeaderRect both adjusted bycontentXandhintGutterWidth.
Pattern Followed
The established pattern from LookedUpWordsActivity, DictionarySuggestionsActivity, EpubReaderMenuActivity, and others:
const int hintGutterWidth = isLandscape ? metrics.sideButtonHintsWidth : 0;
const int contentX = isLandscapeCw ? hintGutterWidth : 0;
Follow-up
Ready for hardware testing in all 4 orientations.