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).
Members
TYPEto_refis_active_propertyis_indeterminate_propertyvalue_propertyminimum_propertymaximum_propertytemplate_settings_propertyconstructnewis_activeset_is_activeis_indeterminateset_is_indeterminatevalueset_range_valueminimumset_minimummaximumset_maximumtemplate_settingsnormalized_value
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ProgressRing>
Returns a strong reference to this object.
is_active_property
fn is_active_property() -> &'static StyledProperty<bool>
Defines the IsActive property: whether the ring is shown and moves. true by
default.
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.
value_property
fn value_property() -> &'static StyledProperty<f64>
Defines the Value property: the progress between Minimum and Maximum. 0 by
default.
minimum_property
fn minimum_property() -> &'static StyledProperty<f64>
Defines the Minimum property. 0 by default.
maximum_property
fn maximum_property() -> &'static StyledProperty<f64>
Defines the Maximum property. 100 by default.
template_settings_property
fn template_settings_property() -> &'static DirectProperty<ProgressRing, Ref<ProgressRingTemplateSettings>>
Defines the TemplateSettings property: the values the template binds to (read-only).
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a progress ring.
is_active
fn is_active(self: &Self) -> bool
Gets whether the ring is shown and moves.
set_is_active
fn set_is_active(self: &Self, value: bool)
Sets whether the ring is shown and moves.
is_indeterminate
fn is_indeterminate(self: &Self) -> bool
Gets whether the ring spins.
set_is_indeterminate
fn set_is_indeterminate(self: &Self, value: bool)
Sets whether the ring spins.
value
fn value(self: &Self) -> f64
Gets the value.
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).
minimum
fn minimum(self: &Self) -> f64
Gets the minimum.
set_minimum
fn set_minimum(self: &Self, value: f64)
Sets the minimum.
maximum
fn maximum(self: &Self) -> f64
Gets the maximum.
set_maximum
fn set_maximum(self: &Self, value: f64)
Sets the maximum.
template_settings
fn template_settings(self: &Self) -> Ref<ProgressRingTemplateSettings>
Gets the values the template binds to; each ring has its own.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<ProgressRing>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplLayoutableImplInteractiveImplInputElementImplFerroObjectImplVisualImplControlImplTemplatedControlImplDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.