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§
Sourcefn buffer_font<'a>(&'a self, cx: &'a App) -> &'a Font
fn buffer_font<'a>(&'a self, cx: &'a App) -> &'a Font
Returns the font used for buffers and the terminal.
Sourcefn ui_font_size(&self, cx: &App) -> Pixels
fn ui_font_size(&self, cx: &App) -> Pixels
Returns the UI font size in pixels.
Sourcefn buffer_font_size(&self, cx: &App) -> Pixels
fn buffer_font_size(&self, cx: &App) -> Pixels
Returns the buffer font size in pixels.
Sourcefn ui_density(&self, cx: &App) -> UiDensity
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".