pub struct ToolbarAction<State: 'static> { /* private fields */ }Expand description
One typed action in ToolbarView::actions — M3EToolbarAction, the
upstream item kind that can move to the overflow menu (its
M3EToolbarWidget sibling, which always stays inline, is this port’s
opaque center slot).
Implementations§
Source§impl<State: 'static> ToolbarAction<State>
impl<State: 'static> ToolbarAction<State>
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
The action’s label — upstream’s label. Used as the overflow row’s
title; the in-button label morph it also drives upstream is unported
(see the module docs’ Not ported).
Sourcepub fn tooltip(self, tooltip: impl Into<String>) -> Self
pub fn tooltip(self, tooltip: impl Into<String>) -> Self
The action’s tooltip text — upstream’s tooltip. This catalog’s icon
button carries no tooltip slot, so this contributes an accessible name
(behind Self::semantic_label) and an overflow-row title (behind
Self::label) only.
Sourcepub fn semantic_label(self, label: impl Into<String>) -> Self
pub fn semantic_label(self, label: impl Into<String>) -> Self
The action’s accessible name — upstream’s semanticLabel.
Sourcepub fn enabled(self, enabled: bool) -> Self
pub fn enabled(self, enabled: bool) -> Self
Whether the action accepts presses (enabled, default true).
Sourcepub fn destructive(self, destructive: bool) -> Self
pub fn destructive(self, destructive: bool) -> Self
Whether the overflow row reads destructive (isDestructive).
Sourcepub fn active(self, active: bool) -> Self
pub fn active(self, active: bool) -> Self
Whether the inline button reads selected (active) — filled icon-button
styling, per M3EToolbarIconButton._resolvedVariant.
Sourcepub fn expand_trigger(self, trigger: bool) -> Self
pub fn expand_trigger(self, trigger: bool) -> Self
Mark this action as the bar’s expand/collapse trigger
(isExpandTrigger): it always stays inline, reserves one inline slot,
and takes the same filled styling an active action does. At most one
action should set it — the first one wins.
The toggle itself stays app-owned (see the module docs’
controlled-prop note): a trigger’s own on_press is where an app flips
ToolbarView::expanded.
The title this action’s overflow row takes — upstream’s
label ?? tooltip ?? semanticLabel ?? 'Action {n}' fallback chain.
Auto Trait Implementations§
impl<State> !RefUnwindSafe for ToolbarAction<State>
impl<State> !Send for ToolbarAction<State>
impl<State> !Sync for ToolbarAction<State>
impl<State> !UnwindSafe for ToolbarAction<State>
impl<State> Freeze for ToolbarAction<State>
impl<State> Unpin for ToolbarAction<State>
impl<State> UnsafeUnpin for ToolbarAction<State>
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.