pub struct Timeline<'a, Message> { /* private fields */ }Available on crate feature
timeline only.Expand description
A timeline builder. Convert it into an Element to render.
A timeline without a message is rendered disabled.
Implementations§
Source§impl<'a, Message> Timeline<'a, Message>
impl<'a, Message> Timeline<'a, Message>
Sourcepub fn lanes(self, lanes: impl IntoIterator<Item = Lane<'a>>) -> Self
pub fn lanes(self, lanes: impl IntoIterator<Item = Lane<'a>>) -> Self
Adds several lanes below the track.
Sourcepub fn label_width(self, width: f32) -> Self
pub fn label_width(self, width: f32) -> Self
Width of the lane labels. Only used when there are lanes.
pub fn width(self, width: impl Into<Length>) -> Self
Sourcepub fn label(self, label: impl IntoFragment<'a>) -> Self
pub fn label(self, label: impl IntoFragment<'a>) -> Self
The name tests and assistive tools know it by. “Timeline” by default.
Sourcepub fn on_select(self, on_select: impl Fn(usize) -> Message + 'a) -> Self
pub fn on_select(self, on_select: impl Fn(usize) -> Message + 'a) -> Self
Sets the message sent with the step under the pointer while pressing or dragging, or the step a shortcut moves to.
Sourcepub fn keymap(self, keymap: Keymap<Action>) -> Self
pub fn keymap(self, keymap: Keymap<Action>) -> Self
Replaces the default_keymap the timeline resolves keys with
while it has keyboard focus or was the last thing pressed.
pub fn current(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_enabled(&self) -> bool
Trait Implementations§
Source§impl<Message> Widget<Message, Theme, ()> for Timeline<'_, Message>
impl<Message> Widget<Message, Theme, ()> for Timeline<'_, Message>
Source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer,
theme: &Theme,
_style: &Style,
layout: Layout<'_>,
cursor: Cursor,
_viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, _style: &Style, layout: Layout<'_>, cursor: Cursor, _viewport: &Rectangle, )
Draws the
Widget using the associated Renderer.Source§fn update(
&mut self,
tree: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
)
fn update( &mut self, tree: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, _viewport: &Rectangle, )
Source§fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, tree: &Tree, layout: Layout<'_>, cursor: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
Auto Trait Implementations§
impl<'a, Message> !RefUnwindSafe for Timeline<'a, Message>
impl<'a, Message> !Send for Timeline<'a, Message>
impl<'a, Message> !Sync for Timeline<'a, Message>
impl<'a, Message> !UnwindSafe for Timeline<'a, Message>
impl<'a, Message> Forget for Timeline<'a, Message>
impl<'a, Message> Freeze for Timeline<'a, Message>
impl<'a, Message> Move for Timeline<'a, Message>
impl<'a, Message> Unpin for Timeline<'a, Message>
impl<'a, Message> UnsafeUnpin for Timeline<'a, Message>where
*const u8 is !null: UnsafeUnpin,
PhantomData<Tone>: UnsafeUnpin,
PhantomData<Lane<'a>>: UnsafeUnpin,
&'a str: UnsafeUnpin,
String: UnsafeUnpin,
PhantomData<(Chord, Action)>: UnsafeUnpin,
*const dyn Fn(usize) -> Message + 'a is !null: UnsafeUnpin,
PhantomData<dyn Fn(usize) -> Message + 'a>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application.