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
//! [`SlintCtx`] — OxiUI [`UiCtx`] implementation that collects widget calls.
//!
//! In M5, `SlintCtx` operates in "collection mode": each `UiCtx` call appends
//! a description string to `items`. The production path renders these items
//! through slint's component API; the headless/test path inspects `items`
//! directly without opening a window.
use ;
/// A [`UiCtx`] adapter that collects widget descriptions for slint rendering.
///
/// Widget calls are recorded in `items` in the order they are invoked.
/// In headless mode (feature `slint` absent, or when no display is available),
/// the collected items can be inspected directly for testing.
///
/// # Example
/// ```
/// use oxiui_slint::SlintCtx;
/// use oxiui_core::UiCtx;
///
/// let mut ctx = SlintCtx::default();
/// ctx.heading("My Window");
/// ctx.label("Status: ok");
/// let resp = ctx.button("Continue");
/// assert_eq!(ctx.items.len(), 3);
/// ```