mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
theme: Change autocomplete value for *_font_fallbacks
(#16759)
This PR follows up #16466, changes the default value used when autocompleting the `ui_font_fallbacks` and `ui_font_fallbacks` settings from `null` to `[]`. Special thanks to @maxdeviant for the guidance on writing better code! Release Notes: - N/A
This commit is contained in:
parent
a2dee8c61e
commit
30a677e257
@ -247,6 +247,7 @@ pub struct ThemeSettingsContent {
|
||||
pub ui_font_family: Option<String>,
|
||||
/// The font fallbacks to use for rendering in the UI.
|
||||
#[serde(default)]
|
||||
#[schemars(default = "default_font_fallbacks")]
|
||||
pub ui_font_fallbacks: Option<Vec<String>>,
|
||||
/// The OpenType features to enable for text in the UI.
|
||||
#[serde(default)]
|
||||
@ -260,6 +261,7 @@ pub struct ThemeSettingsContent {
|
||||
pub buffer_font_family: Option<String>,
|
||||
/// The font fallbacks to use for rendering in text buffers.
|
||||
#[serde(default)]
|
||||
#[schemars(default = "default_font_fallbacks")]
|
||||
pub buffer_font_fallbacks: Option<Vec<String>>,
|
||||
/// The default font size for rendering in text buffers.
|
||||
#[serde(default)]
|
||||
@ -299,6 +301,10 @@ fn default_font_features() -> Option<FontFeatures> {
|
||||
Some(FontFeatures::default())
|
||||
}
|
||||
|
||||
fn default_font_fallbacks() -> Option<FontFallbacks> {
|
||||
Some(FontFallbacks::default())
|
||||
}
|
||||
|
||||
impl ThemeSettingsContent {
|
||||
/// Sets the theme for the given appearance to the theme with the specified name.
|
||||
pub fn set_theme(&mut self, theme_name: String, appearance: Appearance) {
|
||||
|
Loading…
Reference in New Issue
Block a user