pub struct RadialGauge { /* private fields */ }Expand description
A radial normalized value indicator with optional percentage and label.
Values are mapped through [ChartRange], clamped to 0.0..=1.0, and
non-finite values map to zero. The optional percentage is rounded to a whole
number. The default range is 0.0..=1.0, value is zero, and text is hidden.
§Examples
use ailloli_ui_widgets::controls::RadialGauge;
let gauge = RadialGauge::new()
.value(75.0)
.range(0.0, 100.0)
.show_value(true)
.label("Complete");
let _ = gauge;Implementations§
Source§impl RadialGauge
impl RadialGauge
Sourcepub fn width(self, value: impl Into<Length>) -> Self
pub fn width(self, value: impl Into<Length>) -> Self
Sets preferred width from a logical-pixel or length value.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).width(24.0);
let _ = widget;Sourcepub fn height(self, value: impl Into<Length>) -> Self
pub fn height(self, value: impl Into<Length>) -> Self
Sets preferred height from a logical-pixel or length value.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).height(24.0);
let _ = widget;Sourcepub fn min_width(self, value: impl Into<Length>) -> Self
pub fn min_width(self, value: impl Into<Length>) -> Self
Sets the minimum width bound.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).min_width(12.0);
let _ = widget;Sourcepub fn max_width(self, value: impl Into<Length>) -> Self
pub fn max_width(self, value: impl Into<Length>) -> Self
Sets the maximum width bound.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).max_width(32.0);
let _ = widget;Sourcepub fn min_height(self, value: impl Into<Length>) -> Self
pub fn min_height(self, value: impl Into<Length>) -> Self
Sets the minimum height bound.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).min_height(12.0);
let _ = widget;Sourcepub fn max_height(self, value: impl Into<Length>) -> Self
pub fn max_height(self, value: impl Into<Length>) -> Self
Sets the maximum height bound.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).max_height(32.0);
let _ = widget;Sourcepub fn fill(self) -> Self
pub fn fill(self) -> Self
Sets both preferred axes to parent fill.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).fill();
let _ = widget;Sourcepub fn fill_width(self) -> Self
pub fn fill_width(self) -> Self
Sets preferred width to parent fill.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).fill_width();
let _ = widget;Sourcepub fn fill_height(self) -> Self
pub fn fill_height(self) -> Self
Sets preferred height to parent fill.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).fill_height();
let _ = widget;Sourcepub fn margin(self, value: f32) -> Self
pub fn margin(self, value: f32) -> Self
Sets uniform outer margin in logical pixels.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).margin(4.0);
let _ = widget;Sourcepub fn padding(self, value: f32) -> Self
pub fn padding(self, value: f32) -> Self
Sets uniform inner padding in logical pixels.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).padding(4.0);
let _ = widget;Sourcepub fn flex_grow(self) -> Self
pub fn flex_grow(self) -> Self
Sets flex-grow weight to one.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).flex_grow();
let _ = widget;Sourcepub fn flex_grow_by(self, value: f32) -> Self
pub fn flex_grow_by(self, value: f32) -> Self
Sets a dimensionless flex-grow weight.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).flex_grow_by(2.0);
let _ = widget;Sourcepub fn flex_shrink(self, value: f32) -> Self
pub fn flex_shrink(self, value: f32) -> Self
Sets a dimensionless flex-shrink weight.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).flex_shrink(1.0);
let _ = widget;Sourcepub fn flex_basis(self, value: impl Into<Length>) -> Self
pub fn flex_basis(self, value: impl Into<Length>) -> Self
Sets the preferred main-axis flex basis.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).flex_basis(20.0);
let _ = widget;Sourcepub fn align_self(self, value: AlignItems) -> Self
pub fn align_self(self, value: AlignItems) -> Self
Overrides cross-axis alignment for this flex item.
§Examples
use ailloli_ui_core::{style::AlignItems, IconId};
use ailloli_ui_widgets::primitives::Icon;
let widget = Icon::new(IconId::Close).align_self(AlignItems::Center);
let _ = widget;Source§impl RadialGauge
impl RadialGauge
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a zero-valued accent gauge over 0.0..=1.0 with no text.
§Examples
use ailloli_ui_widgets::controls::RadialGauge;
let gauge = RadialGauge::new();
let _ = gauge;Sourcepub fn value(self, value: impl Into<Binding<f32>>) -> Self
pub fn value(self, value: impl Into<Binding<f32>>) -> Self
Sets the static or reactive data value.
Painting maps it through the configured range, clamps out-of-range values, and treats NaN or infinity as the range minimum.
§Examples
use ailloli_ui_widgets::controls::RadialGauge;
let gauge = RadialGauge::new().value(0.75);
let _ = gauge;Sourcepub fn range(self, min: f32, max: f32) -> Self
pub fn range(self, min: f32, max: f32) -> Self
Sets the inclusive sanitized data domain.
Reversed bounds are swapped and non-finite bounds become 0/1.
§Examples
use ailloli_ui_widgets::controls::RadialGauge;
let gauge = RadialGauge::new().range(0.0, 100.0).value(25.0);
let _ = gauge;Sourcepub fn label(self, label: impl Into<Binding<String>>) -> Self
pub fn label(self, label: impl Into<Binding<String>>) -> Self
Sets static or reactive text painted below the ring.
Empty text remains present but paints no glyphs.
§Examples
use ailloli_ui_widgets::controls::RadialGauge;
let gauge = RadialGauge::new().label("Storage");
let _ = gauge;Sourcepub fn show_value(self, show: bool) -> Self
pub fn show_value(self, show: bool) -> Self
Shows or hides a whole-number percentage inside the ring.
The default is false.
§Examples
use ailloli_ui_widgets::controls::RadialGauge;
let gauge = RadialGauge::new().show_value(true);
let _ = gauge;Sourcepub fn tone(self, tone: ChartTone) -> Self
pub fn tone(self, tone: ChartTone) -> Self
Sets the semantic ring fill color.
§Examples
use ailloli_ui_widgets::controls::{ChartTone, RadialGauge};
let gauge = RadialGauge::new().tone(ChartTone::Warning);
let _ = gauge;Sourcepub fn chart_style(self, style: ChartStyle) -> Self
pub fn chart_style(self, style: ChartStyle) -> Self
Replaces complete gauge style and intrinsic geometry.
§Examples
use ailloli_ui_widgets::controls::{ChartStyle, RadialGauge};
let gauge = RadialGauge::new().chart_style(ChartStyle::default());
let _ = gauge;Sourcepub fn chart_size(self, size: ChartSize) -> Self
pub fn chart_size(self, size: ChartSize) -> Self
Replaces style with a default-theme built-in size.
§Examples
use ailloli_ui_widgets::controls::{ChartSize, RadialGauge};
let gauge = RadialGauge::new().chart_size(ChartSize::Large);
let _ = gauge;