Skip to content

Theme asset lazyload #30

@anarchyysm

Description

@anarchyysm

Problem

Goal: only theme.conf loads at boot; icons/, fonts/ and animations/ load on demand.
Estimated effort: 1–2 days

Proposed Solution

  • Implement tos_theme_load_icon(screen_name, icon_name) — tries themes/{theme}/icons/{icon}.png, silent fallback to /assets/icons/
  • Implement tos_theme_load_font(font_name) — tries themes/{theme}/fonts/, fallback to firmware default font
  • Implement tos_theme_load_animation(anim_name) — tries themes/{theme}/animations/, fallback to default animation
  • Ensure fallback is always silent — no missing asset should freeze or display an error on screen
  • Integrate tos_theme_load_icon() in screens that use icons: screens/home/, screens/menu/
  • Integrate tos_theme_load_animation() in the boot screen: screens/boot/
  • Test: theme with no icons/ folder — confirm default icons are used with no errors
  • Test: theme with partial icons/ folder (only some PNGs) — confirm missing icons fall back individually
  • Test: measure boot time with and without lazyload to confirm the gain

Use Case

No response

Alternatives Considered

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions