Skip to main content

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​

NameFormWhat it doesPage
LinearProgressLinearProgress(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
CircularProgressCircularProgress(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.0fPass as value for an animated, indeterminate indicator.Progress
CC_LinearProgressOpts, CC_CircularProgressOptsstructsField structs for the two macros.Progress
CC_LinearProgress, CC_CircularProgressfunctionsWhat the macros call.