pub struct ToolbarItem { /* private fields */ }Expand description
One action in the bar.
The element is what the bar draws; the id and label are what the overflow menu needs to offer the same action when the item does not fit.
Implementations§
Source§impl ToolbarItem
impl ToolbarItem
Sourcepub fn new(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
content: impl IntoElement,
) -> Self
pub fn new( id: impl Into<SharedString>, label: impl Into<SharedString>, content: impl IntoElement, ) -> Self
id is the action’s business identity, and is what the overflow menu
reports when the item is taken from there instead of from the bar.
Sourcepub fn icon(self, glyph: Icon) -> Self
pub fn icon(self, glyph: Icon) -> Self
The glyph the overflow row carries. The inline control draws its own.
pub fn shortcut(self, keystroke: impl Into<SharedString>) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn id(&self) -> &SharedString
pub fn label(&self) -> &SharedString
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ToolbarItem
impl !Send for ToolbarItem
impl !Sync for ToolbarItem
impl !UnwindSafe for ToolbarItem
impl Freeze for ToolbarItem
impl Unpin for ToolbarItem
impl UnsafeUnpin for ToolbarItem
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> 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> ⓘ
Converts
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> ⓘ
Converts
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