pub struct ToolbarAction { /* private fields */ }Expand description
One command of a Toolbar.
Implementations§
Source§impl ToolbarAction
impl ToolbarAction
Sourcepub fn new(label: impl Into<String>) -> ToolbarAction
pub fn new(label: impl Into<String>) -> ToolbarAction
A ghost button with this text.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> ToolbarAction
pub fn accessible_name(self, name: impl Into<String>) -> ToolbarAction
What screen readers call it, instead of its label.
Sourcepub fn accessible_description(self, text: impl Into<String>) -> ToolbarAction
pub fn accessible_description(self, text: impl Into<String>) -> ToolbarAction
What screen readers say after its name. Its keys follow, when it has them.
Sourcepub fn icon(self, icon: IconName) -> ToolbarAction
pub fn icon(self, icon: IconName) -> ToolbarAction
An icon before the label.
Sourcepub fn icon_only(self) -> ToolbarAction
pub fn icon_only(self) -> ToolbarAction
Shows only the icon; the label stays as its name, and in the overflow menu.
Sourcepub fn style(self, style: ButtonStyle) -> ToolbarAction
pub fn style(self, style: ButtonStyle) -> ToolbarAction
The button’s style. Ghost by default.
Sourcepub fn disabled(self, disabled: bool) -> ToolbarAction
pub fn disabled(self, disabled: bool) -> ToolbarAction
Greys the command out. It keeps its place, so its neighbors do not move under the pointer, but it is left out of the overflow menu.
Sourcepub fn hotkey(self, hotkey: Hotkey) -> ToolbarAction
pub fn hotkey(self, hotkey: Hotkey) -> ToolbarAction
Runs the command with these keys, also from the overflow menu’s place, and shows them there. Off while the command is disabled.
Sourcepub fn on_click(self, handler: impl Fn() + 'static) -> ToolbarAction
pub fn on_click(self, handler: impl Fn() + 'static) -> ToolbarAction
Runs handler when the command is chosen.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ToolbarAction
impl !Send for ToolbarAction
impl !Sync for ToolbarAction
impl !UnwindSafe for ToolbarAction
impl Freeze for ToolbarAction
impl Unpin for ToolbarAction
impl UnsafeUnpin for ToolbarAction
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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