pub struct Quantity {Show 20 fields
pub id: String,
pub label: String,
pub value: f64,
pub dim: Dim,
pub bind: Option<Bind>,
pub min: Option<f64>,
pub max: Option<f64>,
pub decimals: usize,
pub error: Option<String>,
pub speed: Option<f64>,
pub width: Option<f32>,
pub enabled: bool,
pub focus: bool,
pub unit: Option<String>,
pub stepper: Option<Stepper>,
pub bare: bool,
pub drag_min: Option<f64>,
pub drag_max: Option<f64>,
pub shown: Option<String>,
pub held: Option<bool>,
}Expand description
A Widget::Quantity: a number as a Widget::Number says it, with
how it drags and how wide it is. Bound to a parameter (bind), it
takes formulas as a bound Number does. Changes come back as
PanelEvent::Number; a stepper’s buttons as the value one up or down.
Fields§
§id: String§label: String§value: f64§dim: Dim§bind: Option<Bind>§min: Option<f64>§max: Option<f64>§decimals: usize§error: Option<String>§speed: Option<f64>How much the value moves per point dragged; left out, as a bound
Number drags.
width: Option<f32>Its width in points.
enabled: bool§focus: boolTakes the keyboard focus this frame, as a field just made does.
unit: Option<String>Written after the value in place of the dim’s unit: N·m.
stepper: Option<Stepper>The value between a down and an up button, in place of a field.
bare: boolThe system’s bare number drag in place of the panel’s field: its
unit written after the value as given, its decimals as the value
needs (none when decimals is 0).
drag_min: Option<f64>The least and largest values a drag (or the wheel, or a stepper’s
buttons) sets, inside min and max: a drag stops there, where a
typed value may go past. For a size that builds only up to a
limit, so that only typing can ask for one that fails.
drag_max: Option<f64>§shown: Option<String>The field’s text as the package has it, written in place of the
value and not edited there: a value typed through the bench’s own
keys, a formula with what it comes to. focus then rings the
field as the one those keys type into.
held: Option<bool>A lock after the field, shut while the value is held (typed, it
no longer follows the cursor). A click on it comes back as
PanelEvent::Toggle with the field’s id.