From 3120a9cbeaf0da1b848793c93eb07cb10d89374a Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 11 Dec 2023 17:39:46 -0500 Subject: [PATCH] theme_importer: Fall back to inactive tab background if no active tab background set (#3598) This PR makes it so the `theme_importer` falls back to the inactive tab background color if the theme doesn't not an active tab background color. This fixes the active tab color in the Synthwave 84 theme. Release Notes: - N/A --- crates/theme2/src/themes/synthwave_84.rs | 1 + crates/theme_importer/src/vscode/converter.rs | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 6b7a73109a..4f62732d7f 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -33,6 +33,7 @@ pub fn synthwave_84() -> UserThemeFamily { toolbar_background: Some(rgba(0x262335ff).into()), tab_bar_background: Some(rgba(0x241b2fff).into()), tab_inactive_background: Some(rgba(0x262335ff).into()), + tab_active_background: Some(rgba(0x262335ff).into()), scrollbar_thumb_background: Some(rgba(0x9d8bca30).into()), scrollbar_thumb_hover_background: Some(rgba(0x9d8bca50).into()), scrollbar_thumb_border: Some(rgba(0x9d8bca30).into()), diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index 9e4dc56eb8..c9a07a1f7f 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -127,6 +127,11 @@ impl VsCodeThemeConverter { .as_ref() .traverse(|color| try_parse_color(&color))?; + let vscode_tab_inactive_background = vscode_colors + .tab_inactive_background + .as_ref() + .traverse(|color| try_parse_color(&color))?; + let vscode_editor_background = vscode_colors .editor_background .as_ref() @@ -213,11 +218,9 @@ impl VsCodeThemeConverter { tab_active_background: vscode_colors .tab_active_background .as_ref() - .traverse(|color| try_parse_color(&color))?, - tab_inactive_background: vscode_colors - .tab_inactive_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, + .traverse(|color| try_parse_color(&color))? + .or(vscode_tab_inactive_background), + tab_inactive_background: vscode_tab_inactive_background, toolbar_background: vscode_colors .breadcrumb_background .as_ref()