pub struct RibbonItem { /* private fields */ }Expand description
A command in a ribbon group: a button, a toggle, or a button with a menu.
Implementations§
Source§impl RibbonItem
impl RibbonItem
A command button (large by default).
Sourcepub fn toggle(
label: impl Into<String>,
icon: IconName,
value: Binding<bool>,
) -> RibbonItem
pub fn toggle( label: impl Into<String>, icon: IconName, value: Binding<bool>, ) -> RibbonItem
A button that stays pressed while value is true (Bold, Ruler…).
Sourcepub fn large(self) -> RibbonItem
pub fn large(self) -> RibbonItem
Shows the item as a large button.
Sourcepub fn small(self) -> RibbonItem
pub fn small(self) -> RibbonItem
Shows the item as a small icon-and-label row.
Sourcepub fn icon_only(self) -> RibbonItem
pub fn icon_only(self) -> RibbonItem
Shows only the icon, with the label as tooltip.
Sourcepub fn on_click(self, handler: impl Fn() + 'static) -> RibbonItem
pub fn on_click(self, handler: impl Fn() + 'static) -> RibbonItem
Runs handler when the item is clicked.
Adds a drop-down item; a button with items opens a menu.
Appends a separator to the drop-down menu.
Sourcepub fn enabled(self, enabled: bool) -> RibbonItem
pub fn enabled(self, enabled: bool) -> RibbonItem
Enables or disables the item; disabled items are dimmed and ignore clicks.
Sourcepub fn tooltip(self, text: impl Into<String>) -> RibbonItem
pub fn tooltip(self, text: impl Into<String>) -> RibbonItem
Hover text (defaults to the label for icon-only items).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RibbonItem
impl !Send for RibbonItem
impl !Sync for RibbonItem
impl !UnwindSafe for RibbonItem
impl Freeze for RibbonItem
impl Unpin for RibbonItem
impl UnsafeUnpin for RibbonItem
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