1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Catalog/Status/Appearance pattern, modeled on libcosmic but trimmed
//! for embedded touch:
//!
//! - **No hover state.** Touch screens have no pointer-over phase.
//! - **No animations / transitions.** Allocate-and-draw budget on an
//! ESP32 doesn't have room for them.
//!
//! A catalog is a function on the [`Theme`](crate::Theme): given a
//! widget *class* (variant — `Standard`, `Suggested`, `Destructive`,
//! …) and a *status* (`Active`, `Focused`, `Pressed`, `Disabled`), return a
//! resolved [`ButtonAppearance`] the widget can paint directly.
//! Widgets never reach into the theme's `Component`/`Container` fields;
//! they call the catalog method.
use PixelColor;
/// Interaction state of a stateful widget. Single shared enum across
/// all interactive widgets — keeps the catalog dispatch table small
/// and the embedded code path predictable.
/// Semantic variant of a button. The catalog maps a class to one of
/// the theme's interactive components (button / accent / destructive
/// / …) without leaking those field names to widget code.
/// Resolved button style — what the widget actually paints.
///
/// `Option`s encode "no fill" / "no border" so a `ButtonClass::Text`
/// can return `background = None, border = None` without us inventing
/// a sentinel transparent color.
/// Catalog for buttons. Implemented by [`crate::Theme`].