pub struct Progress<'a, T> { /* private fields */ }
Expand description
A progress bar that fill up according to some progress
The bar part of the progress bar can be styled by selecting the child widget bar
of the progress
widget.
Progress accepts the clip-bar
flag for it’s style. When the clip-bar
flag is set, the bar is always rendered
at full size and then clipped according to the progress. When clip-bar
is not set, the bar itself is rendered
with a size that matches the progress.
Implementations§
Trait Implementations§
Source§impl<'a, T: 'a> IntoNode<'a, T> for Progress<'a, T>
impl<'a, T: 'a> IntoNode<'a, T> for Progress<'a, T>
Source§impl<'a, T: 'a> Widget<'a, T> for Progress<'a, T>
impl<'a, T: 'a> Widget<'a, T> for Progress<'a, T>
Source§fn widget(&self) -> &'static str
fn widget(&self) -> &'static str
The name of this widget, used to identify widgets of this type in stylesheets.
Source§fn len(&self) -> usize
fn len(&self) -> usize
Should return the amount of children this widget has. Must be consistent with
visit_children()
.Source§fn visit_children(
&mut self,
visitor: &mut dyn FnMut(&mut dyn GenericNode<'a, T>),
)
fn visit_children( &mut self, visitor: &mut dyn FnMut(&mut dyn GenericNode<'a, T>), )
Source§fn size(&self, _: &(), style: &Stylesheet) -> (Size, Size)
fn size(&self, _: &(), style: &Stylesheet) -> (Size, Size)
Returns the
(width, height)
of this widget.
The extents are defined as a Size
,
which will later be resolved to actual dimensions.Source§fn draw(
&mut self,
_: &mut (),
layout: Rectangle,
clip: Rectangle,
style: &Stylesheet,
) -> Vec<Primitive<'a>>
fn draw( &mut self, _: &mut (), layout: Rectangle, clip: Rectangle, style: &Stylesheet, ) -> Vec<Primitive<'a>>
Draw the widget. Returns a list of
Primitive
s that should be drawn. Read moreSource§fn state(&self, _state: &Self::State) -> StateVec
fn state(&self, _state: &Self::State) -> StateVec
The state of this widget, used for computing the style.
If
None
is returned, Node
will automatically compute a state, such as “hover” and “pressed”.Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Returns whether this children has no children. Must be consistent with
visit_children()
.Source§fn hit(
&self,
_state: &Self::State,
layout: Rectangle,
clip: Rectangle,
_style: &Stylesheet,
x: f32,
y: f32,
) -> bool
fn hit( &self, _state: &Self::State, layout: Rectangle, clip: Rectangle, _style: &Stylesheet, x: f32, y: f32, ) -> bool
Source§fn focused(&self, _state: &Self::State) -> bool
fn focused(&self, _state: &Self::State) -> bool
Test the widget for focus exclusivity.
If the widget or one of it’s descendants is in an exclusive focus state, this function should return
true
.
In all other cases, it should return false
. When a widget is in an exclusive focus state it is
the only widget that is allowed to receive events in event
.
Widgets that intended to use this behaviour are modal dialogs, dropdown boxes, context menu’s, etc.Auto Trait Implementations§
impl<'a, T> Freeze for Progress<'a, T>
impl<'a, T> !RefUnwindSafe for Progress<'a, T>
impl<'a, T> Send for Progress<'a, T>
impl<'a, T> !Sync for Progress<'a, T>
impl<'a, T> Unpin for Progress<'a, T>
impl<'a, T> !UnwindSafe for Progress<'a, T>
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