Skip to main content

Icon

Enum Icon 

Source
#[non_exhaustive]
pub enum Icon {
Show 68 variants Check, ChevronRight, ChevronDown, ChevronUp, ChevronLeft, Close, Plus, Minus, Dot, Diamond, Search, Settings, Folder, File, Up, Info, Warning, Error, Success, Undo, Redo, Reset, Copy, Cut, Paste, PasteSpecial, Delete, Keyboard, Command, Menu, More, Edit, Help, Save, Fullscreen, ExitFullscreen, Notification, Theme, Visible, Hidden, History, Home, Lock, Unlock, Picker, TriangleRight, TriangleDown, TriangleUp, Grip, WindowMinimize, WindowMaximize, WindowRestore, WindowClose, Circle, Disc, Square, Triangle, Asterisk, Corner, Phosphor(PhosphorIcon), Layout, LayoutLeft, LayoutLeftOff, LayoutBottom, LayoutBottomOff, LayoutRight, LayoutRightOff, Custom(CustomIcon),
}
Expand description

What an icon means. Each has a glyph in the icon font (with the phosphor feature) and a painted fallback.

Need (icon): an icon by name.

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.
§

Check

A tick: a checked menu item, a passed check.

§

ChevronRight

A submenu, a collapsed section.

§

ChevronDown

An open section, a drop-down.

§

ChevronUp

§

ChevronLeft

§

Close

Close, dismiss, clear.

§

Plus

§

Minus

§

Dot

A small filled dot: a changed value, a status.

§

Diamond

A small filled diamond: a value moved by someone else.

§

Search

§

Settings

§

Folder

§

File

§

Up

Up one folder.

§

Info

§

Warning

§

Error

§

Success

§

Undo

§

Redo

§

Reset

Back to the default.

§

Copy

§

Cut

Cut: scissors.

§

Paste

Paste: a clipboard.

§

PasteSpecial

Paste with a choice (format, transform, parts): a clipboard holding lines.

§

Delete

§

Keyboard

§

Command

The command palette.

§

Menu

A menu (a list).

§

More

More actions.

§

Edit

§

Help

§

Save

§

Fullscreen

§

ExitFullscreen

§

Notification

§

Theme

Light and dark.

§

Visible

§

Hidden

§

History

Recent items.

§

Home

§

Lock

Locked: not to be changed.

§

Unlock

Unlocked: free to change.

§

Picker

An eyedropper: pick a value or a colour from the image.

§

TriangleRight

A filled triangle pointing to the end: a closed branch (always painted, like the dot).

§

TriangleDown

A filled triangle pointing down: an open branch, a descending sort.

§

TriangleUp

A filled triangle pointing up: an ascending sort.

§

Grip

Two dots one above the other: something to grab or to open (a folded area’s strip); always painted.

§

WindowMinimize

A window’s buttons, drawn by the application: a line, a square, two squares, a cross, on the pixel grid; always painted.

§

WindowMaximize

§

WindowRestore

§

WindowClose

§

Circle

Marks filling their square, always painted: what a dot, an LED or a flag shows by default (the kit’s led-* and flag-* glyph roles). A hollow ring.

§

Disc

A filled disc.

§

Square

A filled square.

§

Triangle

A filled triangle, point up.

§

Asterisk

Three crossed strokes.

§

Corner

A triangle filling a corner of its square (the top start one when drawn alone; a corner flag turns it to its corner).

§

Phosphor(PhosphorIcon)

A glyph of the Phosphor font by name (phosphor:grid-four, registry); only with the phosphor feature.

§

Layout

The window’s layout, as a frame of areas: a button opening the layout’s choices (VS Code’s “Customize layout”); always painted.

§

LayoutLeft

A frame with its left area filled: that area shows (a toggle on). The -off icons outline the area instead: it is folded or hidden. Always painted, on the pixel grid.

§

LayoutLeftOff

§

LayoutBottom

A frame with its bottom area filled, or outlined (-off).

§

LayoutBottomOff

§

LayoutRight

A frame with its right area filled, or outlined (-off).

§

LayoutRightOff

§

Custom(CustomIcon)

An icon the application registered (icon_set::register): an SVG file, drawn from textures made when the theme is installed.

Implementations§

Source§

impl Icon

Source

pub const ALL: &'static [Icon]

Every icon, in declaration order (the gallery shows them).

Source

pub fn by_name(name: &str) -> Option<Icon>

The icon of a name (settings), as Icon::name gives it: egui-pop’s, then the Phosphor glyphs’ (phosphor:<name>), then the registered ones (icon_set::register). Resolved once (registry::lookup); registry::resolve also reports a name that does not resolve.

Source

pub fn name(self) -> &'static str

Its name in kebab case (chevron-right): for the debug bridge and the gallery.

Source

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

Its glyph in the icon font; None without the phosphor feature, and for the marks that are always painted (dot, diamond, the triangles).

Source

pub fn size(self, size: Size) -> IconWidget

Sized for a place.

Source

pub fn tone(self, tone: Tone) -> IconWidget

Coloured by a tone.

Source

pub fn label(self, label: &str) -> IconWidget

With an accessible name.

Source

pub fn paint(self, painter: &Painter, rect: Rect, color: Color32)

Paints the icon in a square: the font’s glyph when the icon font is installed in this context, else the painted shape.

Trait Implementations§

Source§

impl Clone for Icon

Source§

fn clone(&self) -> Icon

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Icon

Source§

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

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

impl From<Icon> for IconRef

Source§

fn from(icon: Icon) -> Self

Converts to this type from the input type.
Source§

impl From<Icon> for Source

Source§

fn from(icon: Icon) -> Self

Converts to this type from the input type.
Source§

impl Hash for Icon

Source§

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

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 Ord for Icon

Source§

fn cmp(&self, other: &Icon) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Icon

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Icon

Source§

fn partial_cmp(&self, other: &Icon) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Icon

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Its name: what agents read.

Source§

impl Copy for Icon

Source§

impl Eq for Icon

Source§

impl StructuralPartialEq for Icon

Auto Trait Implementations§

§

impl Freeze for Icon

§

impl RefUnwindSafe for Icon

§

impl Send for Icon

§

impl Sync for Icon

§

impl Unpin for Icon

§

impl UnsafeUnpin for Icon

§

impl UnwindSafe for Icon

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
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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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.
§

impl<T> AsId for T
where T: Hash + Debug,

§

impl<T> AsIdSalt for T
where T: Hash + Debug,

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,