FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ProgressRing

    struct · ferroui-controls · v0.5.0

    struct ProgressRing
    

    A ring that shows that something is in progress (WinUI's ProgressRing): a spinning arc while is_indeterminate (the default), the part of a ring of the value between minimum and maximum otherwise, and nothing while not is_active.

    As in WinUI, Value, Minimum and Maximum are properties of the ring (not of RangeBase), coerced as ProgressRing.cpp coerces them: the bound set last wins, and a value outside the range is moved into it. The control sets the states of WinUI as pseudo-classes, which the control theme of the WinUI theme (src/FerroUI.Themes.WinUI/Controls/ProgressRing.xaml) styles: :active (Active), :determinate-active (DeterminateActive) and :inactive (Inactive).

    WinUI draws the ring with an AnimatedVisualPlayer and the Lottie compositions of its animated visuals, which the code plays. FerroUI has no player: the template draws the ring with Arc shapes, and the control moves the arc of the template part PART_Indicator as the code of WinUI plays the compositions: the indeterminate composition loops over two seconds (the arc grows to half the ring and shrinks while it turns 900 degrees), and a determinate change plays the determinate composition from the old to the new value (two seconds for the whole ring), a decrease at once. The clock is the ring's Clock, or the global clock; the motion stops while the ring is inactive, hidden or out of the visual tree. DeterminateSource and IndeterminateSource (preview members of WinUI) are not ported. The Fluent and Simple themes have no template for it (docs/porting/winui-controls.md, section 5.1).

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ProgressRing>
    

    Returns a strong reference to this object.

    Source

    is_active_property

    fn is_active_property() -> &'static StyledProperty<bool>
    

    Defines the IsActive property: whether the ring is shown and moves. true by default.

    Source

    is_indeterminate_property

    fn is_indeterminate_property() -> &'static StyledProperty<bool>
    

    Defines the IsIndeterminate property: whether the ring spins (true, the default) or shows its value.

    Source

    value_property

    fn value_property() -> &'static StyledProperty<f64>
    

    Defines the Value property: the progress between Minimum and Maximum. 0 by default.

    Source

    minimum_property

    fn minimum_property() -> &'static StyledProperty<f64>
    

    Defines the Minimum property. 0 by default.

    Source

    maximum_property

    fn maximum_property() -> &'static StyledProperty<f64>
    

    Defines the Maximum property. 100 by default.

    Source

    template_settings_property

    fn template_settings_property() -> &'static DirectProperty<ProgressRing, Ref<ProgressRingTemplateSettings>>
    

    Defines the TemplateSettings property: the values the template binds to (read-only).

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a progress ring.

    Source

    is_active

    fn is_active(self: &Self) -> bool
    

    Gets whether the ring is shown and moves.

    Source

    set_is_active

    fn set_is_active(self: &Self, value: bool)
    

    Sets whether the ring is shown and moves.

    Source

    is_indeterminate

    fn is_indeterminate(self: &Self) -> bool
    

    Gets whether the ring spins.

    Source

    set_is_indeterminate

    fn set_is_indeterminate(self: &Self, value: bool)
    

    Sets whether the ring spins.

    Source

    value

    fn value(self: &Self) -> f64
    

    Gets the value.

    Source

    set_range_value

    fn set_range_value(self: &Self, value: f64)
    

    Sets the value (set_range_value, as RangeBase names it: set_value is the setter of properties of the object).

    Source

    minimum

    fn minimum(self: &Self) -> f64
    

    Gets the minimum.

    Source

    set_minimum

    fn set_minimum(self: &Self, value: f64)
    

    Sets the minimum.

    Source

    maximum

    fn maximum(self: &Self) -> f64
    

    Gets the maximum.

    Source

    set_maximum

    fn set_maximum(self: &Self, value: f64)
    

    Sets the maximum.

    Source

    template_settings

    fn template_settings(self: &Self) -> Ref<ProgressRingTemplateSettings>
    

    Gets the values the template binds to; each ring has its own.

    Source

    normalized_value

    fn normalized_value(self: &Self) -> f64
    

    The progress the determinate ring shows, between 0 and 1: (value - minimum) / (maximum - minimum) (ProgressRing::UpdateLottieProgress). A value that is not a number and an empty or infinite range show no progress; the properties keep their values.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.