pub enum Glyph {
Key(String),
Literal(String),
}Expand description
A glyph drawn before a label: an icon of the icon set, which follows the theme and the glyph mode, or a glyph the application gives as it is, such as a Nerd Font code point it looked up in its own table.
Text converts into a key, so cell.icon("folder", None) reads as before.
use qframe::env::Env;
use qframe::icons::Glyph;
let icons = Env::builtin().icons().clone();
assert_eq!(Glyph::key("check").resolve(&icons), "✓");
assert_eq!(Glyph::literal('\u{e745}').resolve(&icons), "\u{e745}");Variants§
Key(String)
The icon key of the icon set, drawn in the glyph mode in use.
Literal(String)
This text, drawn as it is in every glyph mode.
Implementations§
Source§impl Glyph
impl Glyph
Sourcepub fn key(key: impl Into<String>) -> Self
pub fn key(key: impl Into<String>) -> Self
The icon key of the icon set, such as "folder" or an application’s "category.internet".
Sourcepub fn literal(glyph: impl Into<String>) -> Self
pub fn literal(glyph: impl Into<String>) -> Self
A glyph drawn as it is, such as '\u{e745}'. The application answers for the glyph mode: a
Nerd Font code point only belongs on screen when Env::glyph_mode
is GlyphMode::Nerd.
Trait Implementations§
impl Eq for Glyph
impl StructuralPartialEq for Glyph
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnsafeUnpin for Glyph
impl UnwindSafe for Glyph
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
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 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> ⓘ
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