Incular logoIncular
API ReferenceDesign Systems

Meter & Progress

Measurement meters and determinate/indeterminate progress with semantics.

Meter

use incular::prelude::*;
use incular::controls_prelude::{Meter, Progress};

fn main() {
    let app = Application::new(|_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(
                Column::builder()
                    .main_axis_size(MainAxisSize::Min)
                    .spacing(8.0)
                    .children(Vec::<Widget>::from([
                        Meter::new()
                                .value(0.7)
                                .range(0.0, 1.0)
                                .label("Disk").into(),
                        Progress::new()
                                .value(0.4)
                                .label("Loading").into(),
                    ]))
                    .build(),
            )
            .build()
            .into()
    })
    .expect("valid application");
    incular::run(app).expect("run application");
}
PropTypeDefault
valuef320.0
min / maxf320.0 / 1.0
low / high / optimumOption<f32>Zones unset

width, child, and normalized_value() round out the API — see the runnable program above.

Semantics role Meter with "N%" value text.

Progress

indeterminate(true) uses a NaN sentinel with an auto-animating 1200ms ticker; value = None/NaN also means indeterminate. Semantics role ProgressBar with busy flag and numeric metadata — exercised in the runnable program above.

value = None/NaN means indeterminate. Semantics role ProgressBar with busy flag and numeric metadata.

Related: Surfaces.

On this page