Skip to main content

Symbol

Enum Symbol 

Source
#[non_exhaustive]
pub enum Symbol {
Show 54 variants Add, Remove, Delete, Edit, New, Open, Save, Print, Refresh, Search, Share, Settings, Info, Star, Bookmark, Back, Forward, Up, Down, Home, Sidebar, Filter, Sort, More, Play, Pause, Stop, Camera, Code, Light, Dark, Auto, ZoomIn, ZoomOut, ZoomReset, Undo, Redo, Copy, Cut, Paste, Mail, Folder, Document, Check, Close, Warning, Rectangle, Oval, Circle, CircleFilled, Line, Group, Ungroup, Text,
}
Expand description

A standard icon, named by what it means rather than by how it looks, so each backend can draw the platform’s own glyph for it: an SF Symbol on macOS, a freedesktop icon name on GTK and Qt, a Fluent glyph on Windows. This is the only way an icon looks native on every desktop at once; a bundled PNG cannot, because it is one artist’s take on all four.

The set is kept small: the commands that recur across toolbars. Anything app-specific is an Icon::Image.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Add

§

Remove

§

Delete

§

Edit

§

New

§

Open

§

Save

§

Print

§

Refresh

§

Search

§

Share

§

Settings

§

Info

§

Star

§

Bookmark

§

Back

§

Forward

§

Up

§

Down

§

Home

§

Sidebar

Show/hide the sidebar, the leading item of most desktop toolbars.

§

Filter

§

Sort

§

More

An overflow affordance (macOS ellipsis, GNOME’s hamburger, Fluent More).

§

Play

§

Pause

§

Stop

§

Camera

A photo capture: a screenshot command, a camera control.

§

Code

Source code.

§

Light

Light appearance (a sun). The three below are the vocabulary of a theme chooser, which every platform draws with the same three ideas.

§

Dark

Dark appearance (a moon).

§

Auto

Follow the system: the half-filled circle every platform uses for “automatic”.

§

ZoomIn

§

ZoomOut

§

ZoomReset

Back to actual size: the 100% zoom command between Symbol::ZoomIn and Symbol::ZoomOut.

§

Undo

§

Redo

§

Copy

§

Cut

§

Paste

§

Mail

§

Folder

§

Document

§

Check

§

Close

§

Warning

§

Rectangle

A rectangle: the shape vocabulary a drawing surface needs (docs/shapes.md), and the glyphs every drawing, diagram and annotation tool puts in the same place.

§

Oval

An ellipse.

§

Circle

An outlined circle: the read/unread vocabulary (a read row, its dot removed), and the generic ring glyph.

§

CircleFilled

A filled circle: the unread dot itself.

§

Line

A straight line segment.

§

Group

Combine the selection into a group: the drawing-tool command (two stacked squares).

§

Ungroup

Dissolve a group back into its members (two separated squares).

§

Text

Text: a line of type as a drawing element (the drawing-tool “T”).

Implementations§

Source§

impl Symbol

Source

pub fn outline_path(self) -> Option<&'static str>

A 24×24 outline path for this symbol, Day’s own drawing of it.

The platform’s icon comes first on every backend that has one (SF Symbols, the freedesktop icon theme, Fluent’s glyph font). This is the fallback for when that lookup finds nothing, which is not an edge case: view-filter-symbolic exists on a GNOME desktop and nowhere else, so a GTK or Qt app run off that desktop drew a toolbar item with no icon at all. One table here means the same fallback shape everywhere instead of a gap per platform.

None for a variant with no drawing yet: Symbol is #[non_exhaustive], so a new one degrades to a label rather than failing to compile.

Source

pub fn outline_svg(self) -> Option<String>

Self::outline_path wrapped as a standalone SVG document.

Trait Implementations§

Source§

impl Clone for Symbol

Source§

fn clone(&self) -> Symbol

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Symbol

Source§

impl Debug for Symbol

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for Symbol

Source§

impl Hash for Symbol

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Symbol

Source§

fn eq(&self, other: &Symbol) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Symbol

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoReactive<T, StaticMark> for T
where T: Clone + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Day API ↩ Guides· daybrite.dev