Skip to content

feat(ui): add landscape UI mode - #1

Open
Raxcoms wants to merge 20 commits into
developfrom
landscape-ui
Open

Raxcoms wants to merge 20 commits into
developfrom
landscape-ui

Conversation

@Raxcoms

@Raxcoms Raxcoms commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Summary

Full horizontal (landscape) UI support across the CrossPoint Reader firmware.

Changes

Cover Grid (2 columns in landscape)

  • CoverGridHomeUi::gridColumnsFor() returns 2 columns in landscape, 3 in portrait
  • Hero cover card layout uses the dynamic column count for proper sizing

Button Hints (landscape-aware)

All three themes draw button hints on the side edge in landscape mode:

  • BaseTheme (Classic): rectangular hints with rotated labels
  • LyraTheme (Lyra): rounded rectangle hints with rotated labels
  • RoundedRaffTheme (RoundedRaff): two groups of 2 buttons each on the side edge

Labels drawn with drawTextRotated90CW(). CW orientation draws on the left edge, CCW on the right.

Status Bar & Header

Already orientation-aware via getOrientedViewableTRBL() — no changes needed, full-width centered in landscape automatically.

Cover Cache

Already tracks orientation and invalidates on rotation — no changes needed.

- Cover grid now uses 2 columns in landscape instead of 3
- Button hints drawn on side edge in landscape mode with rotated labels
- BaseTheme and LyraTheme both get landscape-aware button hints
- X4 physical buttons map to side edge when rotated to landscape
- Landscape mode draws button hints on the side edge
- Two groups of 2 buttons each positioned vertically on the side
- Text drawn with rotation to match landscape orientation
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Firmware builds

Automatically generated from the merge build for the latest commit of this PR (7a0cef9).

Download and extract the .bin for your device, then flash it with CrossPoint Reader Flash Tools. Make sure you use the correct firmware file for your device.

Firmware unavailable: Sticky, X4 Pro, X4 Classic, Paper Mono, MetalIO EInk4, EEGO A4, BOOX Picco.

Flash and static RAM usage (bytes)

Merge build for PR 7a0cef9 compared with its develop parent 3331d18.

Device Baseline (Total image / linker Flash / RAM) PR (Total image / linker Flash / RAM) Difference (Total image / linker Flash / RAM)
X3 / X4 unavailable / unavailable / unavailable 5,644,016 / 5,629,501 / 66,872 B unavailable / unavailable / unavailable
Sticky unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable
X4 Pro unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable
X4 Classic unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable
Paper Mono unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable
MetalIO EInk4 unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable
EEGO A4 unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable
BOOX Picco unavailable / unavailable / unavailable unavailable / unavailable / unavailable unavailable / unavailable / unavailable

X3 / X4: baseline unavailable — no saved develop build.

Sticky: baseline unavailable — no saved develop build.

Sticky: PR usage unavailable — measurement missing (build may have failed).

X4 Pro: baseline unavailable — no saved develop build.

X4 Pro: PR usage unavailable — measurement missing (build may have failed).

X4 Classic: baseline unavailable — no saved develop build.

X4 Classic: PR usage unavailable — measurement missing (build may have failed).

Paper Mono: baseline unavailable — no saved develop build.

Paper Mono: PR usage unavailable — measurement missing (build may have failed).

MetalIO EInk4: baseline unavailable — no saved develop build.

MetalIO EInk4: PR usage unavailable — measurement missing (build may have failed).

EEGO A4: baseline unavailable — no saved develop build.

EEGO A4: PR usage unavailable — measurement missing (build may have failed).

BOOX Picco: baseline unavailable — no saved develop build.

BOOX Picco: PR usage unavailable — measurement missing (build may have failed).

The X4 reports 480x800 physical dimensions regardless of how it is held,
so the home screen always assumed portrait. Apply SETTINGS.orientation
on home screen enter (like the reader does) and use renderer orientation
instead of physical dimensions to detect landscape mode.
Remove Classic, RoundedRaff, Lyra 3 Covers and the Cover Grid home
variant so the firmware carries only the Lyra theme. UITheme now always
builds LyraTheme (BaseTheme remains the OOM fallback), the UI Theme
setting and its translations are gone, and saved settings files keep
loading (the legacy uiTheme key is simply ignored). HomeActivity loses
the cover-grid path; the text-settings host test runs Lyra metrics only.
The landscape hint rail drew the portrait band and the side rail on top
of each other, and reused portrait x spacing for boxes that are tall
there, so the boxes overlapped. Draw only the rail in landscape, mirror
the portrait band's panel footprint so each box sits over its physical
button in both rotations, key the position table to the portrait panel
width, and center rotated labels accounting for their text running
toward smaller y.
Fold the hint-rail gutter into the fui device safe area (UiAppHost now
derives the device context through railSafeDeviceContext), so lists,
tabs, popups and sheets stop short of the rail in landscape instead of
drawing under it. Replace the hardcoded portrait bottom hint margins
with UITheme::getHintBandBottomInset, and add getHintRailLeftGutter /
getHintRailRightGutter for chrome pinned to a screen edge (library
readout and hold help, keyboard entry, dictionary, bookmarks, remap
warning banner). Portrait values are unchanged.
UITheme::getHint* helpers are static members, so they must go through
getInstance().getMetrics(); drop the now-unused metrics locals in
LibraryListActivity that cppcheck flagged.
The bare pioarduino release URL in platform_packages makes fresh
dependency resolution look for a package named 'registry' and fail
(UnknownPackageError); the same scons 4.8.1 package (4.40801.0) is
published on the official PlatformIO registry, so reference it by
package name. Bump both PlatformIO cache keys so stale resolutions do
not mask the fix.
The battery and clock hug the header corners, which land behind the
button-hint rail in landscape. DrawHeader and the catalog header now
withhold that chrome from the fui header and draw the battery, percent
label and clock as one centered group on the status strip instead.
HeaderChrome.h needed clang-format-21 (the -g wrapper only formats
tracked-modified files, and the header was already committed). In the
catalog header, initialize centeredChrome from header.status so it is
used and not flagged as a dead assignment.
List screens scrolled without any progress indication. UiListActivity
now draws a small "position/count" (like 12/69) at the bottom-right of
the folded content on every list screen: position over pages, since
rows-per-page varies with label wrapping and a page total would change
while scrolling (same rationale as the library's existing readout).
syncListViewport reserves the line, anchored to the content fold so
takeBottom chrome like the bookmarks help line stacks cleanly, and the
fui safe area keeps it clear of the bezel and the landscape hint rail.

Opt-outs: library (own readout), OPDS browser and plugin catalog (their
own page pagers), status-bar settings and text settings (short fixed
lists, the latter under a live preview and layout test).
AP mode stacked two 198px QR codes plus labels, taller than the
480px landscape view. They now sit side by side with their labels
under each code when the content band fits both. Raw-drawn chrome
(QR band, centered text, wifi bars) respects the landscape rail
gutter, matching the FUI screens. Portrait layout unchanged.
GUI is the theme object; UITheme::drawCenteredText is a singleton
static, so GUI.drawCenteredText does not compile.
The home screen stacked the cover tile over the menu, which runs off
the 480px landscape view. Cover card and menu now share the rail-safe
band side by side in landscape; portrait keeps the original rects and
formulas untouched.

Cover/menu rects come from one homeContentLayout() used by both render
and the touch routing in loop(), so hit bands stay on the visuals on
touch boards (X4 has none, but the grid is kept correct). The cover
snapshot rect follows the layout automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant