pub enum ItemIdentifier {
    Custom(&'static str),
    CloudSharing,
    FlexibleSpace,
    Print,
    Colors,
    Fonts,
    Space,
    ToggleSidebar,
    SidebarTracker,
}
Available on crate feature 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.