pub struct ProgressBar { /* private fields */ }Expand description
Linear progress bar.
Implementations§
Source§impl ProgressBar
impl ProgressBar
pub fn new(id: impl Into<ElementId>) -> Self
pub fn value(self, v: f32) -> Self
pub fn min_value(self, v: f32) -> Self
pub fn max_value(self, v: f32) -> Self
Sourcepub fn is_indeterminate(self, v: bool) -> Self
pub fn is_indeterminate(self, v: bool) -> Self
isIndeterminate — an unbounded operation; the bar sweeps instead of
filling to a fraction.
Sourcepub fn value_content(
self,
render: impl Fn(f32, &str, bool) -> AnyElement + 'static,
) -> Self
pub fn value_content( self, render: impl Fn(f32, &str, bool) -> AnyElement + 'static, ) -> Self
ProgressBar.ValueLabel’s render function — handed percentage,
valueText, and isIndeterminate.
Sourcepub fn value_label(self, text: impl Into<SharedString>) -> Self
pub fn value_label(self, text: impl Into<SharedString>) -> Self
valueLabel — replaces the generated percentage.
Sourcepub fn format_options(self, format: NumberFormat) -> Self
pub fn format_options(self, format: NumberFormat) -> Self
formatOptions — v3 defaults to {style: "percent"}.
pub fn size(self, s: Size) -> Self
pub fn color(self, c: Color) -> Self
Sourcepub fn radius(self, radius: impl Into<Pixels>) -> Self
pub fn radius(self, radius: impl Into<Pixels>) -> Self
The corner radius, in place of the size-step’s radius. Both the track
and the fill segments that run inside it follow the override. Not a v3
prop; the removed v2 radius prop is prohibited and this is a
per-component repository extension.
Sourcepub fn sx(self, style: impl FnOnce(Div) -> Div) -> Self
pub fn sx(self, style: impl FnOnce(Div) -> Div) -> Self
The one slot for caller-owned low-level styling: GPUI’s styling methods
(bg, text_color, w, h, p, rounded, border_color, …)
applied to the bar’s root element after every value the size and the
active theme chose, so they win.
Sourcepub fn label(self, l: impl Into<String>) -> Self
pub fn label(self, l: impl Into<String>) -> Self
Label rendered above the track (label + showValueLabel).
pub fn show_value_label(self, v: bool) -> Self
Trait Implementations§
Source§impl IntoElement for ProgressBar
impl IntoElement for ProgressBar
Source§type Element = ViewElement<ProgressBar>
type Element = ViewElement<ProgressBar>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for ProgressBar
impl RenderOnce for ProgressBar
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for ProgressBar
impl !Send for ProgressBar
impl !Sync for ProgressBar
impl !UnwindSafe for ProgressBar
impl Freeze for ProgressBar
impl Unpin for ProgressBar
impl UnsafeUnpin for ProgressBar
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more