mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
theme_importer: Map more colors (#6913)
This PR extends the `theme_importer` to map more colors from VS Code themes. Release Notes: - N/A
This commit is contained in:
parent
ff76b2ec4d
commit
3eb0a2c3c7
@ -73,25 +73,32 @@ impl VsCodeThemeConverter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Ok(StatusColorsContent {
|
Ok(StatusColorsContent {
|
||||||
created: vscode_colors.editor_gutter_added_background.clone(),
|
|
||||||
modified: vscode_colors.editor_gutter_modified_background.clone(),
|
|
||||||
deleted: vscode_colors.editor_gutter_deleted_background.clone(),
|
|
||||||
conflict: vscode_colors
|
conflict: vscode_colors
|
||||||
.git_decoration_conflicting_resource_foreground
|
.git_decoration_conflicting_resource_foreground
|
||||||
.clone(),
|
.clone(),
|
||||||
error: vscode_colors.error_foreground.clone(),
|
created: vscode_colors.editor_gutter_added_background.clone(),
|
||||||
|
deleted: vscode_colors.editor_gutter_deleted_background.clone(),
|
||||||
|
error: vscode_colors.editor_error_foreground.clone(),
|
||||||
|
error_background: vscode_colors.editor_error_background.clone(),
|
||||||
|
error_border: vscode_colors.editor_error_border.clone(),
|
||||||
hidden: vscode_colors.tab_inactive_foreground.clone(),
|
hidden: vscode_colors.tab_inactive_foreground.clone(),
|
||||||
hint: vscode_colors
|
hint: vscode_colors
|
||||||
.editor_inlay_hint_foreground
|
.editor_inlay_hint_foreground
|
||||||
.clone()
|
.clone()
|
||||||
.or(vscode_base_status_colors.hint),
|
.or(vscode_base_status_colors.hint),
|
||||||
|
hint_border: vscode_colors.editor_hint_border.clone(),
|
||||||
ignored: vscode_colors
|
ignored: vscode_colors
|
||||||
.git_decoration_ignored_resource_foreground
|
.git_decoration_ignored_resource_foreground
|
||||||
.clone(),
|
.clone(),
|
||||||
// info: None,
|
info: vscode_colors.editor_info_foreground.clone(),
|
||||||
|
info_background: vscode_colors.editor_info_background.clone(),
|
||||||
|
info_border: vscode_colors.editor_info_border.clone(),
|
||||||
|
modified: vscode_colors.editor_gutter_modified_background.clone(),
|
||||||
// renamed: None,
|
// renamed: None,
|
||||||
// success: None,
|
// success: None,
|
||||||
warning: vscode_colors.list_warning_foreground.clone(),
|
warning: vscode_colors.editor_warning_foreground.clone(),
|
||||||
|
warning_background: vscode_colors.editor_warning_background.clone(),
|
||||||
|
warning_border: vscode_colors.editor_warning_border.clone(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -116,69 +123,71 @@ impl VsCodeThemeConverter {
|
|||||||
border: vscode_panel_border.clone(),
|
border: vscode_panel_border.clone(),
|
||||||
border_variant: vscode_panel_border.clone(),
|
border_variant: vscode_panel_border.clone(),
|
||||||
border_focused: vscode_colors.focus_border.clone(),
|
border_focused: vscode_colors.focus_border.clone(),
|
||||||
border_disabled: vscode_panel_border.clone(),
|
|
||||||
border_selected: vscode_panel_border.clone(),
|
border_selected: vscode_panel_border.clone(),
|
||||||
border_transparent: vscode_panel_border.clone(),
|
border_transparent: vscode_panel_border.clone(),
|
||||||
|
border_disabled: vscode_panel_border.clone(),
|
||||||
elevated_surface_background: vscode_colors.dropdown_background.clone(),
|
elevated_surface_background: vscode_colors.dropdown_background.clone(),
|
||||||
surface_background: vscode_colors.panel_background.clone(),
|
surface_background: vscode_colors.panel_background.clone(),
|
||||||
background: vscode_editor_background.clone(),
|
background: vscode_editor_background.clone(),
|
||||||
title_bar_background: vscode_colors.title_bar_active_background.clone(),
|
|
||||||
status_bar_background: vscode_colors.status_bar_background.clone(),
|
|
||||||
element_background: vscode_colors.button_background.clone(),
|
element_background: vscode_colors.button_background.clone(),
|
||||||
element_hover: vscode_colors.list_hover_background.clone(),
|
element_hover: vscode_colors.list_hover_background.clone(),
|
||||||
element_selected: vscode_colors.list_active_selection_background.clone(),
|
element_selected: vscode_colors.list_active_selection_background.clone(),
|
||||||
|
drop_target_background: vscode_colors.list_drop_background.clone(),
|
||||||
ghost_element_hover: vscode_colors.list_hover_background.clone(),
|
ghost_element_hover: vscode_colors.list_hover_background.clone(),
|
||||||
ghost_element_selected: vscode_colors.list_active_selection_background.clone(),
|
ghost_element_selected: vscode_colors.list_active_selection_background.clone(),
|
||||||
drop_target_background: vscode_colors.list_drop_background.clone(),
|
|
||||||
text: vscode_colors
|
text: vscode_colors
|
||||||
.foreground
|
.foreground
|
||||||
.clone()
|
.clone()
|
||||||
.or(vscode_token_colors_foreground.clone()),
|
.or(vscode_token_colors_foreground.clone()),
|
||||||
text_muted: vscode_colors.tab_inactive_foreground.clone(),
|
text_muted: vscode_colors.tab_inactive_foreground.clone(),
|
||||||
link_text_hover: vscode_colors.text_link_active_foreground.clone(),
|
status_bar_background: vscode_colors.status_bar_background.clone(),
|
||||||
tab_bar_background: vscode_colors.editor_group_header_tabs_background.clone(),
|
title_bar_background: vscode_colors.title_bar_active_background.clone(),
|
||||||
tab_active_background: vscode_colors
|
|
||||||
.tab_active_background
|
|
||||||
.clone()
|
|
||||||
.or(vscode_tab_inactive_background.clone()),
|
|
||||||
tab_inactive_background: vscode_tab_inactive_background.clone(),
|
|
||||||
toolbar_background: vscode_colors
|
toolbar_background: vscode_colors
|
||||||
.breadcrumb_background
|
.breadcrumb_background
|
||||||
.clone()
|
.clone()
|
||||||
.or(vscode_editor_background.clone()),
|
.or(vscode_editor_background.clone()),
|
||||||
|
tab_bar_background: vscode_colors.editor_group_header_tabs_background.clone(),
|
||||||
|
tab_inactive_background: vscode_tab_inactive_background.clone(),
|
||||||
|
tab_active_background: vscode_colors
|
||||||
|
.tab_active_background
|
||||||
|
.clone()
|
||||||
|
.or(vscode_tab_inactive_background.clone()),
|
||||||
|
panel_background: vscode_colors.panel_background.clone(),
|
||||||
|
scrollbar_thumb_background: vscode_scrollbar_slider_background.clone(),
|
||||||
|
scrollbar_thumb_hover_background: vscode_colors
|
||||||
|
.scrollbar_slider_hover_background
|
||||||
|
.clone(),
|
||||||
|
scrollbar_thumb_border: vscode_scrollbar_slider_background.clone(),
|
||||||
|
scrollbar_track_background: vscode_editor_background.clone(),
|
||||||
|
scrollbar_track_border: vscode_colors.editor_overview_ruler_border.clone(),
|
||||||
editor_foreground: vscode_editor_foreground
|
editor_foreground: vscode_editor_foreground
|
||||||
.clone()
|
.clone()
|
||||||
.or(vscode_token_colors_foreground.clone()),
|
.or(vscode_token_colors_foreground.clone()),
|
||||||
editor_background: vscode_editor_background.clone(),
|
editor_background: vscode_editor_background.clone(),
|
||||||
editor_gutter_background: vscode_editor_background.clone(),
|
editor_gutter_background: vscode_editor_background.clone(),
|
||||||
|
editor_active_line_background: vscode_colors.editor_line_highlight_background.clone(),
|
||||||
editor_line_number: vscode_colors.editor_line_number_foreground.clone(),
|
editor_line_number: vscode_colors.editor_line_number_foreground.clone(),
|
||||||
editor_active_line_number: vscode_colors.editor_foreground.clone(),
|
editor_active_line_number: vscode_colors.editor_foreground.clone(),
|
||||||
editor_wrap_guide: vscode_panel_border.clone(),
|
editor_wrap_guide: vscode_panel_border.clone(),
|
||||||
editor_active_wrap_guide: vscode_panel_border.clone(),
|
editor_active_wrap_guide: vscode_panel_border.clone(),
|
||||||
scrollbar_track_background: vscode_editor_background.clone(),
|
|
||||||
scrollbar_track_border: vscode_colors.editor_overview_ruler_border.clone(),
|
|
||||||
scrollbar_thumb_background: vscode_scrollbar_slider_background.clone(),
|
|
||||||
scrollbar_thumb_border: vscode_scrollbar_slider_background.clone(),
|
|
||||||
scrollbar_thumb_hover_background: vscode_colors
|
|
||||||
.scrollbar_slider_hover_background
|
|
||||||
.clone(),
|
|
||||||
terminal_background: vscode_colors.terminal_background.clone(),
|
terminal_background: vscode_colors.terminal_background.clone(),
|
||||||
terminal_ansi_bright_black: vscode_colors.terminal_ansi_bright_black.clone(),
|
|
||||||
terminal_ansi_bright_red: vscode_colors.terminal_ansi_bright_red.clone(),
|
|
||||||
terminal_ansi_bright_green: vscode_colors.terminal_ansi_bright_green.clone(),
|
|
||||||
terminal_ansi_bright_yellow: vscode_colors.terminal_ansi_bright_yellow.clone(),
|
|
||||||
terminal_ansi_bright_blue: vscode_colors.terminal_ansi_bright_blue.clone(),
|
|
||||||
terminal_ansi_bright_magenta: vscode_colors.terminal_ansi_bright_magenta.clone(),
|
|
||||||
terminal_ansi_bright_cyan: vscode_colors.terminal_ansi_bright_cyan.clone(),
|
|
||||||
terminal_ansi_bright_white: vscode_colors.terminal_ansi_bright_white.clone(),
|
|
||||||
terminal_ansi_black: vscode_colors.terminal_ansi_black.clone(),
|
terminal_ansi_black: vscode_colors.terminal_ansi_black.clone(),
|
||||||
|
terminal_ansi_bright_black: vscode_colors.terminal_ansi_bright_black.clone(),
|
||||||
terminal_ansi_red: vscode_colors.terminal_ansi_red.clone(),
|
terminal_ansi_red: vscode_colors.terminal_ansi_red.clone(),
|
||||||
|
terminal_ansi_bright_red: vscode_colors.terminal_ansi_bright_red.clone(),
|
||||||
terminal_ansi_green: vscode_colors.terminal_ansi_green.clone(),
|
terminal_ansi_green: vscode_colors.terminal_ansi_green.clone(),
|
||||||
|
terminal_ansi_bright_green: vscode_colors.terminal_ansi_bright_green.clone(),
|
||||||
terminal_ansi_yellow: vscode_colors.terminal_ansi_yellow.clone(),
|
terminal_ansi_yellow: vscode_colors.terminal_ansi_yellow.clone(),
|
||||||
|
terminal_ansi_bright_yellow: vscode_colors.terminal_ansi_bright_yellow.clone(),
|
||||||
terminal_ansi_blue: vscode_colors.terminal_ansi_blue.clone(),
|
terminal_ansi_blue: vscode_colors.terminal_ansi_blue.clone(),
|
||||||
|
terminal_ansi_bright_blue: vscode_colors.terminal_ansi_bright_blue.clone(),
|
||||||
terminal_ansi_magenta: vscode_colors.terminal_ansi_magenta.clone(),
|
terminal_ansi_magenta: vscode_colors.terminal_ansi_magenta.clone(),
|
||||||
|
terminal_ansi_bright_magenta: vscode_colors.terminal_ansi_bright_magenta.clone(),
|
||||||
terminal_ansi_cyan: vscode_colors.terminal_ansi_cyan.clone(),
|
terminal_ansi_cyan: vscode_colors.terminal_ansi_cyan.clone(),
|
||||||
|
terminal_ansi_bright_cyan: vscode_colors.terminal_ansi_bright_cyan.clone(),
|
||||||
terminal_ansi_white: vscode_colors.terminal_ansi_white.clone(),
|
terminal_ansi_white: vscode_colors.terminal_ansi_white.clone(),
|
||||||
|
terminal_ansi_bright_white: vscode_colors.terminal_ansi_bright_white.clone(),
|
||||||
|
link_text_hover: vscode_colors.text_link_active_foreground.clone(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -647,6 +647,13 @@ pub struct VsCodeColors {
|
|||||||
)]
|
)]
|
||||||
pub editor_hover_highlight_background: Option<String>,
|
pub editor_hover_highlight_background: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editor.lineHighlightBackground",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_line_highlight_background: Option<String>,
|
||||||
|
|
||||||
#[serde(
|
#[serde(
|
||||||
default,
|
default,
|
||||||
rename = "editor.lineHighlightBorder",
|
rename = "editor.lineHighlightBorder",
|
||||||
@ -857,6 +864,20 @@ pub struct VsCodeColors {
|
|||||||
)]
|
)]
|
||||||
pub editor_error_foreground: Option<String>,
|
pub editor_error_foreground: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorError.border",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_error_border: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorError.background",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_error_background: Option<String>,
|
||||||
|
|
||||||
#[serde(
|
#[serde(
|
||||||
default,
|
default,
|
||||||
rename = "editorWarning.foreground",
|
rename = "editorWarning.foreground",
|
||||||
@ -864,6 +885,55 @@ pub struct VsCodeColors {
|
|||||||
)]
|
)]
|
||||||
pub editor_warning_foreground: Option<String>,
|
pub editor_warning_foreground: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorWarning.border",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_warning_border: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorWarning.background",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_warning_background: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorInfo.foreground",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_info_foreground: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorInfo.border",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_info_border: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorInfo.background",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_info_background: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorHint.foreground",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_hint_foreground: Option<String>,
|
||||||
|
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
rename = "editorHint.border",
|
||||||
|
deserialize_with = "empty_string_as_none"
|
||||||
|
)]
|
||||||
|
pub editor_hint_border: Option<String>,
|
||||||
|
|
||||||
#[serde(
|
#[serde(
|
||||||
default,
|
default,
|
||||||
rename = "editorGutter.modifiedBackground",
|
rename = "editorGutter.modifiedBackground",
|
||||||
|
Loading…
Reference in New Issue
Block a user