Skip to main content

Icons

Trait Icons 

Source
pub trait Icons: ThemeExt {
    // Provided methods
    fn icon(&self, icon: impl Into<Icon>) -> Svg { ... }
    fn icon_at(&self, role: TextStyle, icon: impl Into<Icon>) -> Svg { ... }
}

Provided Methods§

Source

fn icon(&self, icon: impl Into<Icon>) -> Svg

An icon at the ladder’s body step, in the plain text tone.

Both are defaults, not decisions: Svg is Styled, so a later .size(..) or .text_color(..) wins, and a component’s own metric stays with the component. What this buys is the floor — icons::icon paints nothing when no colour is set anywhere, because gpui resolves an svg’s tone from its own style and never inherits one, so an icon with a forgotten text_color is invisible rather than wrong.

Source

fn icon_at(&self, role: TextStyle, icon: impl Into<Icon>) -> Svg

The same, sized to a named rung — a caption’s icon beside caption text. The ladder is the one type reads, so the two move together when theme::set_base_text_size does.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Icons for Theme

Implementors§