pub struct ProgressBar { /* private fields */ }Expand description
Progress bar widget.
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn with_value(value: f32) -> Self
pub fn with_value(value: f32) -> Self
Create a progress bar with the given value.
Sourcepub const fn mode(self, mode: ProgressMode) -> Self
pub const fn mode(self, mode: ProgressMode) -> Self
Set the progress mode.
Sourcepub const fn indeterminate(self) -> Self
pub const fn indeterminate(self) -> Self
Set indeterminate mode.
Sourcepub fn corner_radius(self, radius: f32) -> Self
pub fn corner_radius(self, radius: f32) -> Self
Set the corner radius.
Sourcepub const fn track_color(self, color: Color) -> Self
pub const fn track_color(self, color: Color) -> Self
Set the track color (background).
Sourcepub const fn fill_color(self, color: Color) -> Self
pub const fn fill_color(self, color: Color) -> Self
Set the fill color (progress).
Sourcepub const fn with_label(self) -> Self
pub const fn with_label(self) -> Self
Show percentage label.
Sourcepub const fn show_label(self, show: bool) -> Self
pub const fn show_label(self, show: bool) -> Self
Set whether to show the label.
Sourcepub const fn label_color(self, color: Color) -> Self
pub const fn label_color(self, color: Color) -> Self
Set the label color.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set the accessible name.
Sourcepub const fn get_mode(&self) -> ProgressMode
pub const fn get_mode(&self) -> ProgressMode
Get the current mode.
Sourcepub fn percentage(&self) -> u8
pub fn percentage(&self) -> u8
Get the percentage (0-100).
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if progress is complete.
Sourcepub fn is_indeterminate(&self) -> bool
pub fn is_indeterminate(&self) -> bool
Check if indeterminate.
Sourcepub const fn get_track_color(&self) -> Color
pub const fn get_track_color(&self) -> Color
Get the track color.
Sourcepub const fn get_fill_color(&self) -> Color
pub const fn get_fill_color(&self) -> Color
Get the fill color.
Sourcepub const fn get_label_color(&self) -> Color
pub const fn get_label_color(&self) -> Color
Get the label color.
Sourcepub const fn is_label_shown(&self) -> bool
pub const fn is_label_shown(&self) -> bool
Get whether label is shown.
Sourcepub const fn get_min_width(&self) -> f32
pub const fn get_min_width(&self) -> f32
Get the minimum width.
Sourcepub const fn get_height(&self) -> f32
pub const fn get_height(&self) -> f32
Get the height.
Sourcepub const fn get_corner_radius(&self) -> f32
pub const fn get_corner_radius(&self) -> f32
Get the corner radius.
Trait Implementations§
Source§impl Clone for ProgressBar
impl Clone for ProgressBar
Source§fn clone(&self) -> ProgressBar
fn clone(&self) -> ProgressBar
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgressBar
impl Debug for ProgressBar
Source§impl Default for ProgressBar
impl Default for ProgressBar
Source§impl<'de> Deserialize<'de> for ProgressBar
impl<'de> Deserialize<'de> for ProgressBar
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ProgressBar
impl Serialize for ProgressBar
Source§impl Widget for ProgressBar
impl Widget for ProgressBar
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints. Read more
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds. Read more
Source§fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
Handle input events. Read more
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnwindSafe for ProgressBar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more