In development. It changes without notice.
Topic
Reusable Widgets
A scrolling menu that every board drives with its own inputs, and the header's chip that says the clock is not set.
- See also
- Interface Components
Files | |
| file | src/ |
| Shared "clock not set" header warning chip (gate + placement). | |
| file | src/ |
| Scrollable on-device menu system with multi-input navigation. | |
Classes | |
| struct | kleidos:: |
| One menu item entry. More about kleidos:: | |
| class | kleidos:: |
| Scrollable on-device menu: manages scrolling, selection, and rendering. More about kleidos:: | |
Enumerations | |
| enum class | kleidos:: |
| Menu item action types. More about kleidos:: | |
| enum class | kleidos:: |
| Result of a menu interaction for a single frame. More about kleidos:: | |
Functions | |
| int16_t | kleidos:: |
| Width (px) the "clock not set" chip needs, or 0 when the clock is trusted. | |
| int16_t | kleidos:: |
| Width (px) the chip needs as its clock glyph alone, or 0 when the clock is trusted. | |
| int16_t | kleidos:: |
| Draw the "clock not set" chip packed against a right boundary. | |
| int16_t | kleidos:: |
| Draw the chip from a precomputed clockChipReserve result. | |
Enumeration Type Documentation
MenuAction #
MenuItemType #
Function Documentation
clockChipGlyphReserve() #
Width (px) the chip needs as its clock glyph alone, or 0 when the clock is trusted.
The narrower form a header takes where the worded chip would leave its title no room to read (ui::): the Sticks' 135 px bar with "Einstellungen" beside "PONER".
- Parameters
-
Name Direction Meaning canvas in Surface (for measurement). layout in Responsive context (resolved spacing/ fonts).
- Returns
- Chip width in pixels; 0 when no chip will be shown.
clockChipReserve() #
Width (px) the "clock not set" chip needs, or 0 when the clock is trusted.
Pass the result to ui:: so ui:: keeps the title clear of the chip drawn afterwards by drawClockUnsetChip.
- Parameters
-
Name Direction Meaning canvas in Surface (for label measurement). layout in Responsive context (resolved spacing/ fonts).
- Returns
- Chip width in pixels; 0 when no chip will be shown.
drawClockUnsetChip() [1/2] #
Draw the "clock not set" chip packed against a right boundary.
The chip's right edge lands on packRight (the caller's title-clamp boundary: for ui:: callers the returned cluster-left edge, which already includes the pack gap; hand-drawn headers pass their leftmost status token's left edge minus their gap). Vertically centered in a bar of height headerH. No-op while the clock is trusted.
- Parameters
-
Name Direction Meaning canvas in, out Drawing surface. layout in Responsive context (carries the device profile). packRight in Right edge (px) the chip packs against. headerH in Header bar height (px) the chip centers within.
- Returns
- The chip's left edge in pixels, or
packRightwhen nothing was drawn — always a valid right clamp boundary for the caller's title.
drawClockUnsetChip() [2/2] #
Draw the chip from a precomputed clockChipReserve result.
Same drawing contract as the simple overload, but the trust gate and chip width are taken from reserve instead of being re-evaluated, so a caller that already measured the reserve for its title clamp (the header of the Sticks) evaluates trust + width exactly once per paint — a trust flip between the two computations cannot produce a one-frame reserve/draw mismatch.
- Parameters
-
Name Direction Meaning canvas in, out Drawing surface. layout in Responsive context (carries the device profile). packRight in Right edge (px) the chip packs against. headerH in Header bar height (px) the chip centers within. reserve in Chip width from clockChipReserve, or from clockChipGlyphReserve for the glyph alone; <= 0 draws nothing.
- Returns
- The chip's left edge in pixels, or
packRightwhen nothing was drawn — always a valid right clamp boundary for the caller's title.