Progress indicators
LinearProgress draws a bar and CircularProgress draws a ring. Pass a value from 0 to 1, or CC_PROGRESS_INFINITE for an animated indicator when the amount of work is unknown. Both are leaves with no id.
Example
static void download_status(float done) { // done is 0.0 to 1.0
Column("Download", .layout = { .childGap = 8 }) {
LinearProgress(done, .color = ColorHex(0x2D6CDF));
Row("Busy", .layout = { .childGap = 8 }) {
CircularProgress(CC_PROGRESS_INFINITE, .sizing = SizingAll(Fixed(20)));
Text("Connecting");
}
}
}
Reference
| Name | Form | What it does | Page |
|---|---|---|---|
LinearProgress | LinearProgress(float value, .sizing, .color, .trackColor) | Pill-shaped bar. value is 0 to 1, or CC_PROGRESS_INFINITE. Default size { Grow(), Fixed(4) }. Works headless. | Progress |
CircularProgress | CircularProgress(float value, .sizing, .thickness, .color, .trackColor) | Ring that fills clockwise from 12 o'clock. Default size 40×40, stroke 4. Draws nothing headless. | Progress |
CC_PROGRESS_INFINITE | -1.0f | Pass as value for an animated, indeterminate indicator. | Progress |
CC_LinearProgressOpts, CC_CircularProgressOpts | structs | Field structs for the two macros. | Progress |
CC_LinearProgress, CC_CircularProgress | functions | What the macros call. |