From 1c850f495ca6a29fc427dced0d30492487bdf55f Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 8 Dec 2023 14:03:18 -0500 Subject: [PATCH] Use `breadcrumb.background` from VS Code for toolbar background (#3559) This PR changes the color we use for the toolbar background from the VS Code theme to `breadcrumb.background`. If this value isn't set then we fall back to the `editor.background`. Release Notes: - N/A --- crates/theme2/src/themes/andromeda.rs | 2 +- crates/theme2/src/themes/gruvbox.rs | 6 +++++ crates/theme2/src/themes/night_owl.rs | 2 +- crates/theme2/src/themes/noctis.rs | 22 ++++++++-------- crates/theme2/src/themes/palenight.rs | 2 +- crates/theme2/src/themes/rose_pine.rs | 6 ++--- crates/theme2/src/themes/solarized.rs | 2 ++ crates/theme2/src/themes/synthwave_84.rs | 1 + crates/theme_importer/src/vscode/converter.rs | 25 ++++++++----------- 9 files changed, 37 insertions(+), 31 deletions(-) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index c789f4f395..9e61fbe2e0 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -241,7 +241,7 @@ pub fn andromeda() -> UserThemeFamily { text: Some(rgba(0xd5ced9ff).into()), status_bar_background: Some(rgba(0x23262eff).into()), title_bar_background: Some(rgba(0x23262eff).into()), - toolbar_background: Some(rgba(0x23262eff).into()), + toolbar_background: Some(rgba(0x262a33ff).into()), tab_bar_background: Some(rgba(0x23262eff).into()), tab_inactive_background: Some(rgba(0x23262eff).into()), tab_active_background: Some(rgba(0x262a33ff).into()), diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index b27dee65eb..161450dbc0 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -34,6 +34,7 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0xebdbb2ff).into()), status_bar_background: Some(rgba(0x1d2021ff).into()), title_bar_background: Some(rgba(0x1d2021ff).into()), + toolbar_background: Some(rgba(0x1d2021ff).into()), tab_bar_background: Some(rgba(0x1d2021ff).into()), tab_inactive_background: Some(rgba(0x1d2021ff).into()), tab_active_background: Some(rgba(0x32302fff).into()), @@ -317,6 +318,7 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0xebdbb2ff).into()), status_bar_background: Some(rgba(0x282828ff).into()), title_bar_background: Some(rgba(0x282828ff).into()), + toolbar_background: Some(rgba(0x282828ff).into()), tab_bar_background: Some(rgba(0x282828ff).into()), tab_inactive_background: Some(rgba(0x282828ff).into()), tab_active_background: Some(rgba(0x3c3836ff).into()), @@ -600,6 +602,7 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0xebdbb2ff).into()), status_bar_background: Some(rgba(0x32302fff).into()), title_bar_background: Some(rgba(0x32302fff).into()), + toolbar_background: Some(rgba(0x32302fff).into()), tab_bar_background: Some(rgba(0x32302fff).into()), tab_inactive_background: Some(rgba(0x32302fff).into()), tab_active_background: Some(rgba(0x504945ff).into()), @@ -883,6 +886,7 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0x3c3836ff).into()), status_bar_background: Some(rgba(0xf9f5d7ff).into()), title_bar_background: Some(rgba(0xf9f5d7ff).into()), + toolbar_background: Some(rgba(0xf9f5d7ff).into()), tab_bar_background: Some(rgba(0xf9f5d7ff).into()), tab_inactive_background: Some(rgba(0xf9f5d7ff).into()), tab_active_background: Some(rgba(0xf2e5bcff).into()), @@ -1166,6 +1170,7 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0x3c3836ff).into()), status_bar_background: Some(rgba(0xfbf1c7ff).into()), title_bar_background: Some(rgba(0xfbf1c7ff).into()), + toolbar_background: Some(rgba(0xfbf1c7ff).into()), tab_bar_background: Some(rgba(0xfbf1c7ff).into()), tab_inactive_background: Some(rgba(0xfbf1c7ff).into()), tab_active_background: Some(rgba(0xebdbb2ff).into()), @@ -1449,6 +1454,7 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0x3c3836ff).into()), status_bar_background: Some(rgba(0xf2e5bcff).into()), title_bar_background: Some(rgba(0xf2e5bcff).into()), + toolbar_background: Some(rgba(0xf2e5bcff).into()), tab_bar_background: Some(rgba(0xf2e5bcff).into()), tab_inactive_background: Some(rgba(0xf2e5bcff).into()), tab_active_background: Some(rgba(0xd5c4a1ff).into()), diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index cece73f00e..8e4743e371 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -286,7 +286,7 @@ pub fn night_owl() -> UserThemeFamily { text: Some(rgba(0x403f53ff).into()), status_bar_background: Some(rgba(0xf0f0f0ff).into()), title_bar_background: Some(rgba(0xf0f0f0ff).into()), - toolbar_background: Some(rgba(0xf0f0f0ff).into()), + toolbar_background: Some(rgba(0xfbfbfbff).into()), tab_bar_background: Some(rgba(0xf0f0f0ff).into()), tab_inactive_background: Some(rgba(0xf0f0f0ff).into()), tab_active_background: Some(rgba(0xf6f6f6ff).into()), diff --git a/crates/theme2/src/themes/noctis.rs b/crates/theme2/src/themes/noctis.rs index db24e921cc..3a0e96755e 100644 --- a/crates/theme2/src/themes/noctis.rs +++ b/crates/theme2/src/themes/noctis.rs @@ -36,7 +36,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xbecfdaff).into()), status_bar_background: Some(rgba(0x07273bff).into()), title_bar_background: Some(rgba(0x07273bff).into()), - toolbar_background: Some(rgba(0x051b29ff).into()), + toolbar_background: Some(rgba(0x07273bff).into()), tab_bar_background: Some(rgba(0x09334eff).into()), tab_inactive_background: Some(rgba(0x09334eff).into()), tab_active_background: Some(rgba(0x07273bff).into()), @@ -306,7 +306,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xcbbec2ff).into()), status_bar_background: Some(rgba(0x322a2dff).into()), title_bar_background: Some(rgba(0x322a2dff).into()), - toolbar_background: Some(rgba(0x272022ff).into()), + toolbar_background: Some(rgba(0x322a2dff).into()), tab_bar_background: Some(rgba(0x413036ff).into()), tab_inactive_background: Some(rgba(0x413036ff).into()), tab_active_background: Some(rgba(0x322a2dff).into()), @@ -576,7 +576,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0x005661ff).into()), status_bar_background: Some(rgba(0xcaedf2ff).into()), title_bar_background: Some(rgba(0xe7f2f3ff).into()), - toolbar_background: Some(rgba(0xe1eeefff).into()), + toolbar_background: Some(rgba(0xf4f6f6ff).into()), tab_bar_background: Some(rgba(0xcaedf2ff).into()), tab_inactive_background: Some(rgba(0xcaedf2ff).into()), tab_active_background: Some(rgba(0xf4f6f6ff).into()), @@ -846,7 +846,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0x0c006bff).into()), status_bar_background: Some(rgba(0xe2dff6ff).into()), title_bar_background: Some(rgba(0xedecf8ff).into()), - toolbar_background: Some(rgba(0xe9e7f3ff).into()), + toolbar_background: Some(rgba(0xf2f1f8ff).into()), tab_bar_background: Some(rgba(0xe2dff6ff).into()), tab_inactive_background: Some(rgba(0xe2dff6ff).into()), tab_active_background: Some(rgba(0xf2f1f8ff).into()), @@ -1116,7 +1116,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0x005661ff).into()), status_bar_background: Some(rgba(0xf0e9d6ff).into()), title_bar_background: Some(rgba(0xf9f1e1ff).into()), - toolbar_background: Some(rgba(0xf6eddaff).into()), + toolbar_background: Some(rgba(0xfef8ecff).into()), tab_bar_background: Some(rgba(0xf0e9d6ff).into()), tab_inactive_background: Some(rgba(0xf0e9d6ff).into()), tab_active_background: Some(rgba(0xfef8ecff).into()), @@ -1386,7 +1386,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xc5cdd3ff).into()), status_bar_background: Some(rgba(0x1b2932ff).into()), title_bar_background: Some(rgba(0x1b2932ff).into()), - toolbar_background: Some(rgba(0x0e1920ff).into()), + toolbar_background: Some(rgba(0x1b2932ff).into()), tab_bar_background: Some(rgba(0x24333dff).into()), tab_inactive_background: Some(rgba(0x202e37ff).into()), tab_active_background: Some(rgba(0x1b2932ff).into()), @@ -1656,7 +1656,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xb2cacdff).into()), status_bar_background: Some(rgba(0x041d20ff).into()), title_bar_background: Some(rgba(0x041d20ff).into()), - toolbar_background: Some(rgba(0x03191bff).into()), + toolbar_background: Some(rgba(0x052529ff).into()), tab_bar_background: Some(rgba(0x062e32ff).into()), tab_inactive_background: Some(rgba(0x062e32ff).into()), tab_active_background: Some(rgba(0x052529ff).into()), @@ -1926,7 +1926,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xb2cacdff).into()), status_bar_background: Some(rgba(0x031417ff).into()), title_bar_background: Some(rgba(0x031417ff).into()), - toolbar_background: Some(rgba(0x020c0eff).into()), + toolbar_background: Some(rgba(0x031417ff).into()), tab_bar_background: Some(rgba(0x062e32ff).into()), tab_inactive_background: Some(rgba(0x062e32ff).into()), tab_active_background: Some(rgba(0x031417ff).into()), @@ -2196,7 +2196,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xb2cacdff).into()), status_bar_background: Some(rgba(0x031417ff).into()), title_bar_background: Some(rgba(0x031417ff).into()), - toolbar_background: Some(rgba(0x020c0eff).into()), + toolbar_background: Some(rgba(0x031417ff).into()), tab_bar_background: Some(rgba(0x062e32ff).into()), tab_inactive_background: Some(rgba(0x062e32ff).into()), tab_active_background: Some(rgba(0x031417ff).into()), @@ -2466,7 +2466,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xc5c2d6ff).into()), status_bar_background: Some(rgba(0x292640ff).into()), title_bar_background: Some(rgba(0x292640ff).into()), - toolbar_background: Some(rgba(0x1f1d30ff).into()), + toolbar_background: Some(rgba(0x292640ff).into()), tab_bar_background: Some(rgba(0x2f2c49ff).into()), tab_inactive_background: Some(rgba(0x2f2c49ff).into()), tab_active_background: Some(rgba(0x292640ff).into()), @@ -2736,7 +2736,7 @@ pub fn noctis() -> UserThemeFamily { text: Some(rgba(0xccbfd9ff).into()), status_bar_background: Some(rgba(0x30243dff).into()), title_bar_background: Some(rgba(0x30243dff).into()), - toolbar_background: Some(rgba(0x291d35ff).into()), + toolbar_background: Some(rgba(0x30243dff).into()), tab_bar_background: Some(rgba(0x3d2e4dff).into()), tab_inactive_background: Some(rgba(0x3d2e4dff).into()), tab_active_background: Some(rgba(0x30243dff).into()), diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 710a0c7c83..3036a0ffdb 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -594,7 +594,7 @@ pub fn palenight() -> UserThemeFamily { text: Some(rgba(0xffffffff).into()), status_bar_background: Some(rgba(0x25293aff).into()), title_bar_background: Some(rgba(0x25293aff).into()), - toolbar_background: Some(rgba(0x25293aff).into()), + toolbar_background: Some(rgba(0x292d3eff).into()), tab_bar_background: Some(rgba(0x31364aff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x25293aff).into()), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 0f3592cb0f..d115eca6d3 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -36,7 +36,7 @@ pub fn rose_pine() -> UserThemeFamily { text: Some(rgba(0xe0def4ff).into()), status_bar_background: Some(rgba(0x191724ff).into()), title_bar_background: Some(rgba(0x191724ff).into()), - toolbar_background: Some(rgba(0x1f1d2eff).into()), + toolbar_background: Some(rgba(0x191724ff).into()), tab_bar_background: Some(rgba(0x00000000).into()), tab_inactive_background: Some(rgba(0x00000000).into()), tab_active_background: Some(rgba(0x6e6a861a).into()), @@ -287,7 +287,7 @@ pub fn rose_pine() -> UserThemeFamily { text: Some(rgba(0xe0def4ff).into()), status_bar_background: Some(rgba(0x232136ff).into()), title_bar_background: Some(rgba(0x232136ff).into()), - toolbar_background: Some(rgba(0x2a273fff).into()), + toolbar_background: Some(rgba(0x232136ff).into()), tab_bar_background: Some(rgba(0x00000000).into()), tab_inactive_background: Some(rgba(0x00000000).into()), tab_active_background: Some(rgba(0x817c9c14).into()), @@ -538,7 +538,7 @@ pub fn rose_pine() -> UserThemeFamily { text: Some(rgba(0x575279ff).into()), status_bar_background: Some(rgba(0xfaf4edff).into()), title_bar_background: Some(rgba(0xfaf4edff).into()), - toolbar_background: Some(rgba(0xfffaf3ff).into()), + toolbar_background: Some(rgba(0xfaf4edff).into()), tab_bar_background: Some(rgba(0x00000000).into()), tab_inactive_background: Some(rgba(0x00000000).into()), tab_active_background: Some(rgba(0x6e6a860d).into()), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 71a1ed0204..9a7e6c145f 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -34,6 +34,7 @@ pub fn solarized() -> UserThemeFamily { text: Some(rgba(0xbbbbbbff).into()), status_bar_background: Some(rgba(0x00212bff).into()), title_bar_background: Some(rgba(0x002c39ff).into()), + toolbar_background: Some(rgba(0x002b36ff).into()), tab_bar_background: Some(rgba(0x004052ff).into()), tab_inactive_background: Some(rgba(0x004052ff).into()), tab_active_background: Some(rgba(0x002b37ff).into()), @@ -295,6 +296,7 @@ pub fn solarized() -> UserThemeFamily { text: Some(rgba(0x333333ff).into()), status_bar_background: Some(rgba(0xeee8d5ff).into()), title_bar_background: Some(rgba(0xeee8d5ff).into()), + toolbar_background: Some(rgba(0xfdf6e3ff).into()), tab_bar_background: Some(rgba(0xd9d2c2ff).into()), tab_inactive_background: Some(rgba(0xd3cbb7ff).into()), tab_active_background: Some(rgba(0xfdf6e3ff).into()), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 4849fb9f37..5d6214e231 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -28,6 +28,7 @@ pub fn synthwave_84() -> UserThemeFamily { text: Some(rgba(0xffffffff).into()), status_bar_background: Some(rgba(0x241b2fff).into()), title_bar_background: Some(rgba(0x241b2fff).into()), + toolbar_background: Some(rgba(0x262335ff).into()), tab_bar_background: Some(rgba(0x241b2fff).into()), tab_inactive_background: Some(rgba(0x262335ff).into()), editor_background: Some(rgba(0x262335ff).into()), diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index 596aa09b93..6c5ef51fe6 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -122,6 +122,11 @@ impl VsCodeThemeConverter { fn convert_theme_colors(&self) -> Result { let vscode_colors = &self.theme.colors; + let vscode_editor_background = vscode_colors + .editor_background + .as_ref() + .traverse(|color| try_parse_color(&color))?; + Ok(ThemeColorsRefinement { border: vscode_colors .panel_border @@ -155,10 +160,7 @@ impl VsCodeThemeConverter { .panel_background .as_ref() .traverse(|color| try_parse_color(&color))?, - background: vscode_colors - .editor_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, + background: vscode_editor_background, title_bar_background: vscode_colors .title_bar_active_background .as_ref() @@ -214,17 +216,12 @@ impl VsCodeThemeConverter { .as_ref() .traverse(|color| try_parse_color(&color))?, toolbar_background: vscode_colors - .panel_background + .breadcrumb_background .as_ref() - .traverse(|color| try_parse_color(&color))?, - editor_background: vscode_colors - .editor_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - editor_gutter_background: vscode_colors - .editor_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, + .traverse(|color| try_parse_color(&color))? + .or(vscode_editor_background), + editor_background: vscode_editor_background, + editor_gutter_background: vscode_editor_background, editor_line_number: vscode_colors .editor_line_number_foreground .as_ref()