Meter
既知の範囲内のスカラー測定値を、低・高・最適のセマンティックな帯域とともに表示します。
デモを読み込み中…
meter(70.0, 0.0, 100.0).w(240.0).h(8.0)#インポート
quickgui から meter をインポートします。
use quickgui::*;#使い方
meter(70.0, 0.0, 100.0).w(240.0).h(8.0)#構成
meter::rootmeter::trackmeter::indicatormeter::labelmeter::value
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Meter
ソースを見るpub fn new(value: f64, minimum: f64, maximum: f64) -> SelfCreate a meter. Non-finite bounds fall back to `0.0..=1.0` and an inverted range is swapped.
lowpub fn low(mut self, low: f64) -> Self—
Mark the upper end of the low range. Values outside the meter bounds are clamped.
pub fn low(mut self, low: f64) -> Selfソースを見るhighpub fn high(mut self, high: f64) -> Self—
optimumpub fn optimum(mut self, optimum: f64) -> Self—
idpub fn id(mut self, id: impl Into<ElementId>) -> Self—
Give this meter a stable identity so its label and value parts can be related to it.
pub fn id(mut self, id: impl Into<ElementId>) -> Selfソースを見るformatpub fn format(mut self, format: ValueFormat) -> Self—
Attach a bounded value formatter, Base UI's `format` prop.
pub fn format(mut self, format: ValueFormat) -> Selfソースを見るvalue_textpub fn value_text(mut self, text: impl Into<Arc<str>>) -> Self—
Attach a human-readable value that assistive technology prefers over the raw number. This is Base UI's `getAriaValueText`; an empty string clears it. It wins over [`Self::format`].
pub fn value_text(mut self, text: impl Into<Arc<str>>) -> Selfソースを見るdisplay_valuepub fn display_value(&self) -> Option<Arc<str>>—
The formatted text for a caller-owned value part.
pub fn display_value(&self) -> Option<Arc<str>>ソースを見るaccessible_valuepub fn accessible_value(&self) -> Option<Arc<str>>—
The text assistive technology reads for the value, if any.
pub fn accessible_value(&self) -> Option<Arc<str>>ソースを見るlabel_idpub fn label_id(&self) -> Option<ElementId>—
Stable identity of the label part, when this meter declares one.
pub fn label_id(&self) -> Option<ElementId>ソースを見るvalue_idpub fn value_id(&self) -> Option<ElementId>—
Stable identity of the value part, when this meter declares one.
pub fn value_id(&self) -> Option<ElementId>ソースを見るtrack_idpub fn track_id(&self) -> Option<ElementId>—
Stable identity of the track part, when this meter declares one.
pub fn track_id(&self) -> Option<ElementId>ソースを見るindicator_idpub fn indicator_id(&self) -> Option<ElementId>—
Stable identity of the indicator part, when this meter declares one.
pub fn indicator_id(&self) -> Option<ElementId>ソースを見るcurrent_valuepub const fn current_value(&self) -> f64—
minimumpub const fn minimum(&self) -> f64—
maximumpub const fn maximum(&self) -> f64—
low_valuepub const fn low_value(&self) -> Option<f64>—
high_valuepub const fn high_value(&self) -> Option<f64>—
optimum_valuepub const fn optimum_value(&self) -> Option<f64>—
completionpub fn completion(&self) -> f32—
The `0.0..=1.0` position of the value inside the meter's range.
pub fn completion(&self) -> f32ソースを見るis_lowpub fn is_low(&self) -> bool—
is_highpub fn is_high(&self) -> bool—
Meter::root_with
ソースを見るpub fn root_with(&self, root: Element) -> ElementDecorate an application-owned root without adding layout or appearance.
Meter::root
ソースを見るpub fn root(&self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Meter::track_with
ソースを見るpub fn track_with(&self, track: Element) -> ElementDecorate the caller-owned track that the fill is measured inside.
Meter::track
ソースを見るpub fn track(&self) -> ElementCreate the unstyled track part. Use [`Self::track_with`] to supply an existing element.
Meter::indicator_with
ソースを見るpub fn indicator_with(&self, indicator: Element) -> ElementHide an application-owned fill from the accessible name.
Meter::indicator
ソースを見るpub fn indicator(&self) -> ElementCreate the unstyled indicator part. Use [`Self::indicator_with`] to supply an existing element.
Meter::label_with
ソースを見るpub fn label_with(&self, label: Element) -> ElementAssign the stable mounted label target the root points at.
Meter::label
ソースを見るpub fn label(&self) -> ElementCreate the unstyled label part. Use [`Self::label_with`] to supply an existing element.
Meter::value
ソースを見るpub fn value(&self) -> ElementAssign the stable mounted value target the root points at. Create the unstyled value text part.
Meter::value_with
ソースを見るpub fn value_with(&self, value: Element) -> Elementmeter
ソースを見るpub fn meter(value: f64, minimum: f64, maximum: f64) -> ElementCreate an unstyled meter root. This shorthand is equivalent to `Meter::new(value, minimum, maximum).root_with(div())`.
