Struct theme2::ThemeSettings
source · pub struct ThemeSettings {
pub ui_font_size: Pixels,
pub ui_font: Font,
pub buffer_font: Font,
pub buffer_font_size: Pixels,
pub buffer_line_height: BufferLineHeight,
pub active_theme: Arc<Theme>,
}
Fields§
§ui_font_size: Pixels
§ui_font: Font
§buffer_font: Font
§buffer_font_size: Pixels
§buffer_line_height: BufferLineHeight
§active_theme: Arc<Theme>
Implementations§
source§impl ThemeSettings
impl ThemeSettings
pub fn buffer_font_size(&self, cx: &mut AppContext) -> Pixels
pub fn line_height(&self) -> f32
Trait Implementations§
source§impl Clone for ThemeSettings
impl Clone for ThemeSettings
source§fn clone(&self) -> ThemeSettings
fn clone(&self) -> ThemeSettings
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Settings for ThemeSettings
impl Settings for ThemeSettings
source§const KEY: Option<&'static str> = None
const KEY: Option<&'static str> = None
The name of a key within the JSON file from which this setting should
be deserialized. If this is
None
, then the setting will be deserialized
from the root object.§type FileContent = ThemeSettingsContent
type FileContent = ThemeSettingsContent
The type that is stored in an individual JSON file.
source§fn load(
defaults: &Self::FileContent,
user_values: &[&Self::FileContent],
cx: &mut AppContext
) -> Result<Self>
fn load( defaults: &Self::FileContent, user_values: &[&Self::FileContent], cx: &mut AppContext ) -> Result<Self>
The logic for combining together values from one or more JSON files into the
final value for this setting. Read more
fn json_schema( generator: &mut SchemaGenerator, params: &SettingsJsonSchemaParams<'_>, cx: &AppContext ) -> RootSchema
fn json_merge( default_value: &Self::FileContent, user_values: &[&Self::FileContent] ) -> Result<Self::FileContent, Error>
fn missing_default() -> Error
fn register(cx: &mut AppContext)where Self: Sized,
fn get<'a>(path: Option<(usize, &Path)>, cx: &'a AppContext) -> &'a Selfwhere Self: Sized,
fn get_global<'a>(cx: &'a AppContext) -> &'a Selfwhere Self: Sized,
fn override_global<'a>(settings: Self, cx: &'a mut AppContext)where Self: Sized,
Auto Trait Implementations§
impl RefUnwindSafe for ThemeSettings
impl Send for ThemeSettings
impl Sync for ThemeSettings
impl Unpin for ThemeSettings
impl UnwindSafe for ThemeSettings
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