ProgressBar

Struct ProgressBar 

Source
pub struct ProgressBar {
    pub value: f32,
    pub size: Size2d,
    pub foreground: Box<dyn Frame>,
    pub background: Box<dyn Frame>,
}
Available on crate feature el_progress_bar only.

Fields§

§value: f32

Current progress, should be in the range 0.0..=1.0

§size: Size2d

Size of the progress bar element

§foreground: Box<dyn Frame>

Foreground (bar) color

§background: Box<dyn Frame>

Background color

Implementations§

Source§

impl ProgressBar

Source

pub fn with_value(self, value: f32) -> Self

Sets the value field of this struct.

Source

pub fn with_size(self, value: impl Into<Size2d>) -> Self

Sets the size field of this struct.

Source§

impl ProgressBar

Source

pub const DEFAULT_HEIGHT: f32 = 20f32

Source

pub fn with_background(self, frame: impl Frame + 'static) -> Self

Source

pub fn with_foreground(self, frame: impl Frame + 'static) -> Self

Trait Implementations§

Source§

impl Default for ProgressBar

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl UiElement for ProgressBar

Source§

fn name(&self) -> &'static str

Get the name of the element (in lower case) Read more
Source§

fn measure(&self, ctx: MeasureContext<'_>) -> Response

Measure step, guaranteed to be called before the process step
May be called multiple times per single frame, so it should not contain any expensive calls
This function may not mutate any state.\ Read more
Source§

fn process(&self, ctx: ProcessContext<'_>)

Process step, guaranteed to be called after the measure step
You should process the user inputs and render the element here.
Source§

fn size(&self) -> Option<Size2d>

Get the requested UiElement size Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ElementInteractableExt for T
where T: UiElement + 'static,

Source§

fn into_interactable<S, F>( self, event: InteractableEvent, signal: F, ) -> Interactable
where S: Signal, F: Fn() -> S + 'static,

Available on crate feature el_interactable only.
Wrap the element in an Interactable that will call the given signal when the specified event occurs
Source§

fn on_click<S, F>(self, signal: F) -> Interactable
where S: Signal, F: Fn() -> S + 'static,

Available on crate feature el_interactable only.
Wrap the element in an Interactable that will call the given signal when clicked
Source§

fn on_hover<S, F>(self, signal: F) -> Interactable
where S: Signal, F: Fn() -> S + 'static,

Available on crate feature el_interactable only.
Wrap the element in an Interactable that will call the given signal continuously while hovered
Source§

fn on_active<S, F>(self, signal: F) -> Interactable
where S: Signal, F: Fn() -> S + 'static,

Available on crate feature el_interactable only.
Wrap the element in an Interactable that will call the given signal continuously while active
Source§

impl<T> ElementTransformExt for T
where T: UiElement + 'static,

Source§

fn transform(self) -> Transformer

Available on crate feature el_transformer only.
Wrap the element in a Transformer Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UiElementExt for T
where T: UiElement + 'static,

Source§

fn add_child(self, ui: &mut ElementList)

Add element as a child/nested element.
Source§

fn add_root(self, ui: &mut UiInstance, rect: impl Into<Rect>)

Add element as a ui root.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V