pub enum ItemIdentifier {
Custom(&'static str),
CloudSharing,
FlexibleSpace,
Print,
Colors,
Fonts,
Space,
ToggleSidebar,
SidebarTracker,
}
appkit
only.Expand description
Represents an item identifier for items in a Toolbar.
Variants
Custom(&'static str)
Represents a custom item. Use this when you need to handle your own item types.
CloudSharing
Represents a standard cloud-sharing icon. Available from 10.12 onwards.
FlexibleSpace
A flexible space identifier. Fills space, flexibly.
Print
A standard print toolbar item. Will send the necessary print calls to the first responder.
Colors
A standard identifier for showing the colors panel.
Fonts
A standard identifier for showing the fonts panel.
Space
A standard identifier for showing blank space.
ToggleSidebar
Standard toolbar item identifier for a sidebar. Will handle automatically hiding and showing a SplitViewController sidebar if it’s the window content view controller and the first responder.
Note that this API was introduced in Big Sur (11.0), and you may need to check against this at runtime to ensure behavior is appropriate on older OS versions (if you support them).
SidebarTracker
Standard toolbar item for a spot that tracks the sidebar border. In your delegate, use this to indicate what items should be on the side of the sidebar and content.
For example:
use cacao::appkit::toolbar::ItemIdentifier;
vec![ItemIdentifier::ToggleSidebar, ItemIdentifier::SidebarTracker, ItemIdentifier::Print];
Would result in the toggle sidebar item showing up in the sidebar on the left, and the print item showing up in the content area on the right.
Note that this API was introduced in Big Sur (11.0), and you may need to check against this at runtime to ensure behavior is appropriate on older OS versions (if you support them).
Trait Implementations
sourceimpl Clone for ItemIdentifier
impl Clone for ItemIdentifier
sourcefn clone(&self) -> ItemIdentifier
fn clone(&self) -> ItemIdentifier
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ItemIdentifier
impl Send for ItemIdentifier
impl Sync for ItemIdentifier
impl Unpin for ItemIdentifier
impl UnwindSafe for ItemIdentifier
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more