Struct ToolbarCommand
pub struct ToolbarCommand {
pub label: String,
pub icon: Option<Icon>,
pub swatch: Option<AlphaColor<Srgb>>,
pub active: Option<bool>,
pub accessible_name: Option<String>,
pub enabled: bool,
pub dot: bool,
pub priority: i32,
pub menu: Option<Vec<MenuItem>>,
pub joined: bool,
pub on_click: Box<dyn FnMut()>,
/* private fields */
}Expand description
One command of a toolbar and what it carries.
Fields§
§label: StringThe command’s visible label, or the accessible name and tooltip of an icon-only command.
icon: Option<Icon>Shown instead of the label when present.
swatch: Option<AlphaColor<Srgb>>A colour well shown instead of a label or icon (the colour the next mark takes); the label is its accessible name and tooltip.
active: Option<bool>Some for a toggle; Some(true) paints the lift.
accessible_name: Option<String>What assistive technology and the More menu call it, when that differs from the label (a toggle labelled “Aa” is “Match case”).
enabled: boolA disabled command is dimmed, announced as disabled and inert.
dot: boolA dot at the command’s corner: something new behind it.
priority: i32Higher stays visible longer when the row is too narrow; equal priorities give way from the end.
Some opens a menu anchored to the command instead of running it.
joined: boolGoes with the command before it: the two (zoom out, zoom in) give way to the More menu together, never one without the other.
on_click: Box<dyn FnMut()>Auto Trait Implementations§
impl Freeze for ToolbarCommand
impl !RefUnwindSafe for ToolbarCommand
impl !Send for ToolbarCommand
impl !Sync for ToolbarCommand
impl Unpin for ToolbarCommand
impl UnsafeUnpin for ToolbarCommand
impl !UnwindSafe for ToolbarCommand
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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