Progress
確定または不確定のタスク進捗を、組み合わせ可能なラベルとトラックで表します。
デモを読み込み中…
progress(0.4, 1.0).w(240.0).h(8.0).rounded(4.0)#インポート
quickgui から progress をインポートします。
use quickgui::*;#使い方
progress(0.4, 1.0).w(240.0).h(8.0).rounded(4.0)#構成
progress::rootprogress::trackprogress::indicatorprogress::labelprogress::value
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Progress
ソースを見るpub fn new(value: f64, maximum: f64) -> SelfCreate a determinate indicator between `0.0` and `maximum`. A non-finite or non-positive maximum falls back to `1.0`; the value is clamped into range.
fractionpub fn fraction(fraction: f64) -> Self—
Create a determinate indicator from a `0.0..=1.0` completion fraction.
pub fn fraction(fraction: f64) -> Selfソースを見るindeterminatepub fn indeterminate() -> Self—
value_textpub fn value_text(mut self, text: impl Into<Arc<str>>) -> Self—
Attach a human-readable value such as `"3 of 12 files"`. Assistive technology prefers this over the raw number when present. An empty string clears it. The text is not rendered; the application owns every visible label.
pub fn value_text(mut self, text: impl Into<Arc<str>>) -> Selfソースを見るidpub fn id(mut self, id: impl Into<ElementId>) -> Self—
Give this indicator a stable identity so its label and value parts can be related to it. Without an identity the parts are still decorated, but QuickGUI cannot point the root's accessible name and description at them, so the application supplies its own `accessibility_label`. Existing code that never declares an identity is unchanged.
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. The result is what [`Self::display_value`] returns for a caller-owned value part, and what assistive technology reads unless [`Self::value_text`] overrides it.
pub fn format(mut self, format: ValueFormat) -> Selfソースを見るstatuspub fn status(&self) -> ProgressStatus—
Which of Base UI's three progress states this indicator is in.
pub fn status(&self) -> ProgressStatusソースを見るstatepub fn state(&self) -> ProgressPartState—
A copyable snapshot of what Base UI exposes as `data-*` attributes.
pub fn state(&self) -> ProgressPartStateソースを見るdisplay_valuepub fn display_value(&self) -> Option<Arc<str>>—
The formatted text for a caller-owned value part, or `None` while indeterminate.
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. An explicit [`Self::value_text`] wins over [`Self::format`], matching Base UI's `getAriaValueText` precedence.
pub fn accessible_value(&self) -> Option<Arc<str>>ソースを見るlabel_idpub fn label_id(&self) -> Option<ElementId>—
Stable identity of the label part, when this indicator 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 indicator 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 indicator 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 indicator declares one.
pub fn indicator_id(&self) -> Option<ElementId>ソースを見るcurrent_valuepub const fn current_value(&self) -> Option<f64>—
maximumpub const fn maximum(&self) -> f64—
is_indeterminatepub const fn is_indeterminate(&self) -> bool—
completionpub fn completion(&self) -> Option<f32>—
The `0.0..=1.0` completion fraction, or `None` while indeterminate. Applications use this to size a caller-owned fill.
pub fn completion(&self) -> Option<f32>ソースを見るProgress::root_with
ソースを見るpub fn root_with(&self, root: Element) -> ElementDecorate an application-owned root without adding layout or appearance.
Progress::root
ソースを見るpub fn root(&self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Progress::track_with
ソースを見るpub fn track_with(&self, track: Element) -> ElementDecorate the caller-owned track that the fill is measured inside. The track is decoration: the root already carries the numeric value and bounds, so the track and everything under it stay out of the accessible name.
Progress::track
ソースを見るpub fn track(&self) -> ElementCreate the unstyled track part. Use [`Self::track_with`] to supply an existing element.
Progress::indicator_with
ソースを見るpub fn indicator_with(&self, indicator: Element) -> ElementHide an application-owned fill or animation from the accessible name.
Progress::indicator
ソースを見るpub fn indicator(&self) -> ElementCreate the unstyled indicator part. Use [`Self::indicator_with`] to supply an existing element.
Progress::label_with
ソースを見るpub fn label_with(&self, label: Element) -> ElementAssign the stable mounted label target the root points at.
Progress::label
ソースを見るpub fn label(&self) -> ElementCreate the unstyled label part. Use [`Self::label_with`] to supply an existing element.
Progress::value
ソースを見るpub fn value(&self) -> ElementAssign the stable mounted value target the root points at. Put [`Self::display_value`] inside it; QuickGUI never renders the text itself. Create the unstyled value text part.
Progress::value_with
ソースを見るpub fn value_with(&self, value: Element) -> Elementprogress
ソースを見るpub fn progress(value: f64, maximum: f64) -> ElementCreate an unstyled determinate progress root. This shorthand is equivalent to `Progress::new(value, maximum).root_with(div())`.
