#[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
Add
Remove
Delete
Edit
New
Open
Save
Refresh
Search
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
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
impl Symbol
Sourcepub fn outline_path(self) -> Option<&'static str>
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.
Sourcepub fn outline_svg(self) -> Option<String>
pub fn outline_svg(self) -> Option<String>
Self::outline_path wrapped as a standalone SVG document.
Trait Implementations§
impl Copy for Symbol
impl Eq for Symbol
impl StructuralPartialEq for Symbol
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnsafeUnpin for Symbol
impl UnwindSafe for Symbol
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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