Skip to main content

GlyphSet

Struct GlyphSet 

Source
pub struct GlyphSet {
    pub track_vertical: char,
    pub track_horizontal: char,
    pub arrow_vertical_start: char,
    pub arrow_vertical_end: char,
    pub arrow_horizontal_start: char,
    pub arrow_horizontal_end: char,
    pub thumb_vertical_lower: [char; 8],
    pub thumb_vertical_upper: [char; 8],
    pub thumb_horizontal_left: [char; 8],
    pub thumb_horizontal_right: [char; 8],
}
Expand description

Glyphs used to render the track, arrows, and thumb.

Arrays use indices 0..=7 to represent 1/8th through full coverage.

Fields§

§track_vertical: char

Track glyph for vertical scrollbars.

§track_horizontal: char

Track glyph for horizontal scrollbars.

§arrow_vertical_start: char

Arrow glyph for the start of a vertical scrollbar (top).

§arrow_vertical_end: char

Arrow glyph for the end of a vertical scrollbar (bottom).

§arrow_horizontal_start: char

Arrow glyph for the start of a horizontal scrollbar (left).

§arrow_horizontal_end: char

Arrow glyph for the end of a horizontal scrollbar (right).

§thumb_vertical_lower: [char; 8]

Thumb glyphs for vertical lower fills (1/8th through full).

§thumb_vertical_upper: [char; 8]

Thumb glyphs for vertical upper fills (1/8th through full).

§thumb_horizontal_left: [char; 8]

Thumb glyphs for horizontal left fills (1/8th through full).

§thumb_horizontal_right: [char; 8]

Thumb glyphs for horizontal right fills (1/8th through full).

Implementations§

Source§

impl GlyphSet

Source

pub const fn minimal() -> Self

Minimal glyphs: no visible track by default.

This uses a space character for the track so the scrollbar is “all thumb”, with the background color coming from track_style.

[██      ]
[🮋█▏     ]
[🮊█▎     ]
[🮉█▍     ]
[▐█▌     ]
[🮈█▋     ]
[🮇█▊     ]
[▕█▉     ]
[ ██     ]
Source

pub const fn box_drawing() -> Self

Glyphs that include box-drawing line symbols for the track.

[██──────]
[🮋█▏─────]
[🮊█▎─────]
[🮉█▍─────]
[▐█▌─────]
[🮈█▋─────]
[🮇█▊─────]
[▕█▉─────]
[─██─────]
Source

pub const fn symbols_for_legacy_computing() -> Self

Glyphs that mix standard block elements with legacy supplement glyphs.

Use this to get full 1/8th coverage for upper and right edges that the standard block set lacks; these glyphs come from Symbols for Legacy Computing.

[██──────]
[🮋█▏─────]
[🮊█▎─────]
[🮉█▍─────]
[▐█▌─────]
[🮈█▋─────]
[🮇█▊─────]
[▕█▉─────]
[─██─────]
Source

pub const fn unicode() -> Self

Glyphs using only standard Unicode block elements.

Use this if your font lacks the legacy glyphs.

The standard block set does not include 1/8th upper or right fills (those come from [Symbols for Legacy Computing]), so this set approximates upper and right partials by rounding to coarse blocks:

  • ~1/4: /
  • ~1/2 and ~3/4: /
  • ~7/8 and full:
[██──────]
[██▏─────]
[▐█▎─────]
[▐█▍─────]
[▐█▌─────]
[▐█▋─────]
[▕█▊─────]
[▕█▉─────]
[─██─────]

Trait Implementations§

Source§

impl Clone for GlyphSet

Source§

fn clone(&self) -> GlyphSet

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 Debug for GlyphSet

Source§

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

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

impl Default for GlyphSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for GlyphSet

Source§

impl PartialEq for GlyphSet

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for GlyphSet

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

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

Source§

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