Skip to content

feat(pixmap): add BlocksPixmap registry and Icon key enum - #323

Open
gmmcosta15 wants to merge 1 commit into
test/resource-key-guard-ui-scanfrom
feat/blocks-pixmap
Open

feat(pixmap): add BlocksPixmap registry and Icon key enum#323
gmmcosta15 wants to merge 1 commit into
test/resource-key-guard-ui-scanfrom
feat/blocks-pixmap

Conversation

@gmmcosta15

Copy link
Copy Markdown
Collaborator

Description

  • Feature

  • Icon, a StrEnum with one member per resource key the handwritten panels draw.

  • Icon.wifi(bars, protected), clamped to the 0..4 assets that exist.

  • BlocksPixmap.icon(), a shared QIcon per path.

  • BlocksPixmap.get(icon, size), a cached raster, 128x128 by default.

  • BlocksPixmap.source(icon), the intrinsic-size pixmap, for full-bleed art only.

  • BlocksPixmap.clear(), called from on_quit while qApp is alive.

  • Bounded cache: on overflow the oldest half is dropped.

  • No caller converted here; module and tests only.

Motivation

Each panel built its own pixmap from a raw literal, so every icon was rasterized once per widget: 273.0 MiB intrinsic against 16.1 MiB for the same set at 64px on the RF50. Two QIcon objects over one path do not share a render cache, so the registry holds the QIcon. Eviction is safe because a widget keeps its own reference; the worst case is a duplicate, never a null.

Tests

make check green; unit tests for the enum, cache, wifi clamp and eviction. All 83 keys are :/ literals, so the PR 2 guard proves they resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request. python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant