Skip to content

refactor(color): UI layout logic to better handle different screen sizes and orientations #6134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 6, 2025

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Apr 24, 2025

To ensure correct sizing and placement on large and small LCD sizes.

@philmoz philmoz added color Related generally to color LCD radios house keeping 🧹 Cleanup of code and house keeping labels Apr 24, 2025
@philmoz philmoz added this to the 2.11.1 milestone Apr 24, 2025
@philmoz philmoz force-pushed the philmoz/layout-settings branch from 9d5639a to e66fe9a Compare April 26, 2025 00:48
@philmoz philmoz marked this pull request as draft April 26, 2025 01:47
@philmoz philmoz force-pushed the philmoz/layout-settings branch 2 times, most recently from b3865a6 to d7b94cf Compare May 1, 2025 04:56
@philmoz philmoz marked this pull request as ready for review May 1, 2025 04:57
@philmoz
Copy link
Collaborator Author

philmoz commented May 1, 2025

The layout handling system has been revised to better support all the current and upcoming variations.

The UI code now operates on three properties:

  • Orientation - Landscape or Portrait (determined on ratio of LCD_W to LCD_H)
  • Width factor - normal or narrow
  • Scaling factor- 80% for landscape with LCD_W = 320, 150% for landscape with LCD_W = 800, 100% for all others.

Orientation is self explanatory.

Width factor is used to adjust layouts where the default font size results in the UI not fitting in the available width. In this case an alternate layout is used that splits the UI elements across more lines. E.G. Outputs, global variables, etc.

Scaling factor is used to adjust font sizes, bitmap sizes and UI position and size co-ordinates to fit the available space.
The scaling is designed so that the default height for controls (buttons, etc) is approx 1.4" (6mm) for of touch operation.

All three factors are set by the UI at build time - the target radio definitions only need to set LCD_W and LCD_H.

Current variants:

  • 480x272, 480x320 - landscape orientation, normal width, 100% scaling
  • 320x240 - landscape orientation, narrow width, 80% scaling
  • 800x480 - landscape orientation, normal width, 150% scaling
  • 320x480 - portrait orientation, narrow width, 100% scaling

@philmoz philmoz changed the title chore(color): replace magic numbers with LAYOUT macros for screen layouts. chore(color): refactor color UI layout logic to better handle different screen sizes and orientations. May 1, 2025
@philmoz philmoz force-pushed the philmoz/layout-settings branch from d7b94cf to 226b752 Compare May 2, 2025 11:37
@pfeerick pfeerick added the needs: rebase A git rebase on top of the latest destination branch version is required label May 5, 2025
@philmoz philmoz force-pushed the philmoz/layout-settings branch from 226b752 to 7186642 Compare May 5, 2025 23:17
@pfeerick pfeerick removed the needs: rebase A git rebase on top of the latest destination branch version is required label May 6, 2025
@pfeerick pfeerick changed the title chore(color): refactor color UI layout logic to better handle different screen sizes and orientations. refactor(color): UI layout logic to better handle different screen sizes and orientations May 6, 2025
@pfeerick pfeerick merged commit fa54a44 into main May 6, 2025
53 checks passed
@pfeerick pfeerick deleted the philmoz/layout-settings branch May 6, 2025 03:50
@pfeerick
Copy link
Member

pfeerick commented May 6, 2025

Can you do a 2.11 PR version for this also... I think it should be fairly minor to rebase against 2.11 as only three files conflicted (color_picker/_editor and startup_shutdown), but you're more familiar with the changes you've been making here ;)

@philmoz
Copy link
Collaborator Author

philmoz commented May 6, 2025

Can you do a 2.11 PR version for this also... I think it should be fairly minor to rebase against 2.11 as only three files conflicted (color_picker/_editor and startup_shutdown), but you're more familiar with the changes you've been making here ;)

Ummm - you deleted the branch !!!

@pfeerick pfeerick restored the philmoz/layout-settings branch May 6, 2025 04:46
@pfeerick
Copy link
Member

pfeerick commented May 6, 2025

Sorry, they auto-delete on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color Related generally to color LCD radios house keeping 🧹 Cleanup of code and house keeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants