Skip to content

Add optional horizontal (landscape) layout mode - #431

Open
kfezer wants to merge 1 commit into
aceinnolab:mainfrom
kfezer:feature/horizontal-layout
Open

Add optional horizontal (landscape) layout mode#431
kfezer wants to merge 1 commit into
aceinnolab:mainfrom
kfezer:feature/horizontal-layout

Conversation

@kfezer

@kfezer kfezer commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Adds a top-level "layout": "horizontal" setting to settings.json that keeps the display's native landscape orientation and tiles modules left-to-right instead of the default top-to-bottom stacking.
  • Each module's size is then read as [column width, full height] instead of [full width, row height].
  • Default behavior (layout absent, or set to anything other than "horizontal") is completely unchanged — this is purely additive, gated behind the new setting.
  • No changes needed to individual module classes (Calendar, Xkcd, etc.) — they already just render into whatever box _assemble() gives them.

Related to the long-requested horizontal mode discussed in #117. That thread was closed pending a fuller 2-column grid rewrite ("would require a 2-column grid instead of one"). This PR is a smaller, pragmatic step that gets basic side-by-side layouts working today without that larger rewrite — happy to adjust direction if a fuller grid system is still preferred instead.

Test plan

  • Verified on real hardware: 12.48" colour e-paper (epd_12_in_48_colour) on a Raspberry Pi Zero 2 W, with layout: horizontal, Calendar module on the left (size: [550, 964]) and Xkcd module on the right (size: [754, 964]). Both rendered correctly and matched the assigned columns.
  • Confirmed default (no layout key) still produces the original vertical-stacked layout — the vertical code path is untouched, only reached via an added if/else branch.
  • python3 -m py_compile inkycal/main.py passes.
  • No new automated test added for _assemble() — the existing tests/test_main.py doesn't cover this method and I didn't want to bolt on test scaffolding without knowing your preferred fixture/mocking approach for module image composition. Happy to add one if you can point me at a pattern to follow.

Docs

Added a short section to docs/docs/modules.md explaining the new setting and showing an example.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there and welcome to Inkycal. Thanks for opening this issue. As this is your first Pull-Request in this repository, please read through the contributing guidelines. Please note that non-critical pull-request cannot be merged into the main branch to ensure stability. Please create a new branch and ask to have it merged into main. Thanks for your understanding.

Adds a top-level "layout": "horizontal" setting that keeps the display's
native landscape orientation and tiles modules left-to-right instead of
the default top-to-bottom stacking. Each module's "size" is then read as
[column width, full height] instead of [full width, row height].

Default behavior (layout absent or anything other than "horizontal") is
completely unchanged - this is purely additive.

Addresses the long-requested horizontal mode from aceinnolab#117, without requiring
the fuller 2-column grid rewrite discussed there. Verified end-to-end on
real hardware (12.48" colour e-paper, Pi Zero 2 W): Calendar module on the
left, Xkcd module on the right, both rendering correctly with the same
existing module code (no per-module changes needed).
@kfezer
kfezer force-pushed the feature/horizontal-layout branch from 85e787f to 0faff2d Compare August 4, 2026 20:40
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