pub struct ToolbarAction { /* private fields */ }Expand description
One labeled command or toggle rendered inside a Toolbar.
Implementations§
Source§impl ToolbarAction
impl ToolbarAction
Sourcepub fn new(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
icon: IconName,
) -> ToolbarAction
pub fn new( id: impl Into<SharedString>, label: impl Into<SharedString>, icon: IconName, ) -> ToolbarAction
Creates a toolbar action with a stable id, accessible label, and Material icon.
Sourcepub fn with_icon<E>(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
icon: impl Fn() -> E + 'static,
) -> ToolbarActionwhere
E: IntoElement,
pub fn with_icon<E>(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
icon: impl Fn() -> E + 'static,
) -> ToolbarActionwhere
E: IntoElement,
Creates a toolbar action with a custom repeatable icon factory used both inline and in the collapsed overflow menu.
Sourcepub fn disabled(self, disabled: bool) -> ToolbarAction
pub fn disabled(self, disabled: bool) -> ToolbarAction
Disables activation for this action when true.
Sourcepub fn selected(self, selected: bool) -> ToolbarAction
pub fn selected(self, selected: bool) -> ToolbarAction
Marks a controlled toggle and specifies its current state.
Sourcepub fn secondary(self, secondary: bool) -> ToolbarAction
pub fn secondary(self, secondary: bool) -> ToolbarAction
Places this action in the overflow menu when the toolbar is collapsed.
Sourcepub fn on_activate(
self,
invoke: impl Fn(&mut Window, &mut App) + 'static,
) -> ToolbarAction
pub fn on_activate( self, invoke: impl Fn(&mut Window, &mut App) + 'static, ) -> ToolbarAction
Registers a callback invoked when the action is activated via pointer, keyboard, or accessibility.
Auto Trait Implementations§
impl !RefUnwindSafe for ToolbarAction
impl !Send for ToolbarAction
impl !Sync for ToolbarAction
impl !UnwindSafe for ToolbarAction
impl Forget for ToolbarAction
impl Freeze for ToolbarAction
impl Move for ToolbarAction
impl Unpin for ToolbarAction
impl UnsafeUnpin for ToolbarAction
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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