#[non_exhaustive]pub struct ToolItem {
pub kind: ToolKind,
pub key: String,
pub icon: Option<String>,
pub label: Option<String>,
pub name: Option<String>,
pub on: bool,
pub disabled: bool,
}Expand description
One toolbar entry (toolbar).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ToolKind§key: StringThe hit key ({id}:{key}).
icon: Option<String>The icon’s SVG markup (e.g. icon(body) or an app’s own icon set).
label: Option<String>§name: Option<String>The accessible name (and tooltip text); defaults to the label or the key.
on: boolLit: the active tool, or a toggled option.
disabled: boolShown dimmed, no hit.
Implementations§
Source§impl ToolItem
impl ToolItem
An icon button.
Sourcepub fn split(key: impl Into<String>, icon_svg: impl Into<String>) -> ToolItem
pub fn split(key: impl Into<String>, icon_svg: impl Into<String>) -> ToolItem
A button with a flyout chevron.
pub fn label(self, l: impl Into<String>) -> ToolItem
pub fn name(self, n: impl Into<String>) -> ToolItem
pub fn on(self, on: bool) -> ToolItem
pub fn disabled(self, on: bool) -> ToolItem
Trait Implementations§
Auto Trait Implementations§
impl Forget for ToolItem
impl Freeze for ToolItem
impl Move for ToolItem
impl RefUnwindSafe for ToolItem
impl Send for ToolItem
impl Sync for ToolItem
impl Unpin for ToolItem
impl UnsafeUnpin for ToolItem
impl UnwindSafe for ToolItem
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