Skip to main content

ThemeSettingsProvider

Trait ThemeSettingsProvider 

Source
pub trait ThemeSettingsProvider:
    Send
    + Sync
    + 'static {
    // Required methods
    fn ui_font<'a>(&'a self, cx: &'a App) -> &'a Font;
    fn buffer_font<'a>(&'a self, cx: &'a App) -> &'a Font;
    fn ui_font_size(&self, cx: &App) -> Pixels;
    fn buffer_font_size(&self, cx: &App) -> Pixels;
    fn ui_density(&self, cx: &App) -> UiDensity;
}
Expand description

Trait for providing theme-related settings (fonts, font sizes, UI density) without coupling to the concrete settings infrastructure.

A concrete implementation is registered as a global by the theme_settings crate.

Required Methods§

Source

fn ui_font<'a>(&'a self, cx: &'a App) -> &'a Font

Returns the font used for UI elements.

Source

fn buffer_font<'a>(&'a self, cx: &'a App) -> &'a Font

Returns the font used for buffers and the terminal.

Source

fn ui_font_size(&self, cx: &App) -> Pixels

Returns the UI font size in pixels.

Source

fn buffer_font_size(&self, cx: &App) -> Pixels

Returns the buffer font size in pixels.

Source

fn ui_density(&self, cx: &App) -> UiDensity

Returns the current UI density setting.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§