pub struct ToolbarItem {
pub id: String,
pub kind: ToolbarItemKind,
pub label: String,
pub tooltip: Option<String>,
pub icon: Option<Icon>,
pub enabled: bool,
pub action: u64,
}Expand description
One item in a window’s toolbar (docs/toolbars.md).
Fields§
§id: StringStable identity: the native item identifier, the dayscript target, and the key a
ToolbarPatch addresses. Unique within a toolbar.
kind: ToolbarItemKind§label: StringThe item’s name. Shown beside or below the icon where the platform does that, and used verbatim in the overflow and customization menus — so it is never optional, even on a toolbar that only shows icons. It is also the item’s accessible name.
tooltip: Option<String>Hover help. Defaults to label where the platform expects a tooltip and none is given.
icon: Option<Icon>§enabled: bool§action: u64The item’s command, as a dispatch id from the same registry Event::MenuAction uses
(0 = no command), so a toolbar button and its menu twin can share one closure.
Trait Implementations§
Source§impl Clone for ToolbarItem
impl Clone for ToolbarItem
Source§fn clone(&self) -> ToolbarItem
fn clone(&self) -> ToolbarItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolbarItem
impl Debug for ToolbarItem
Source§impl PartialEq for ToolbarItem
impl PartialEq for ToolbarItem
Source§fn eq(&self, other: &ToolbarItem) -> bool
fn eq(&self, other: &ToolbarItem) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ToolbarItem
Auto Trait Implementations§
impl Freeze for ToolbarItem
impl RefUnwindSafe for ToolbarItem
impl Send for ToolbarItem
impl Sync for ToolbarItem
impl Unpin for ToolbarItem
impl UnsafeUnpin for ToolbarItem
impl UnwindSafe 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