Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
theme: Add `scrollbar_thumb_active_background` color (#30177)
Finn Evers9c1b2afa4927
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rsindex 24e833c1e67..0f20ac626ee 100644--- a/crates/editor/src/element.rs+++ b/crates/editor/src/element.rs@@ -5280,7 +5280,10 @@ impl EditorElement {}let scrollbar_thumb_color = match scrollbar_layout.thumb_state {- ScrollbarThumbState::Dragging | ScrollbarThumbState::Hovered => {+ ScrollbarThumbState::Dragging => {+ cx.theme().colors().scrollbar_thumb_active_background+ }+ ScrollbarThumbState::Hovered => {cx.theme().colors().scrollbar_thumb_hover_background}ScrollbarThumbState::Idle => cx.theme().colors().scrollbar_thumb_background,diff --git a/crates/theme/src/default_colors.rs b/crates/theme/src/default_colors.rsindex 6eca890bdfb..d6580fe2e13 100644--- a/crates/theme/src/default_colors.rs+++ b/crates/theme/src/default_colors.rs@@ -86,6 +86,7 @@ impl ThemeColors {pane_group_border: neutral().light().step_6(),scrollbar_thumb_background: neutral().light_alpha().step_3(),scrollbar_thumb_hover_background: neutral().light_alpha().step_4(),+ scrollbar_thumb_active_background: neutral().light_alpha().step_5(),scrollbar_thumb_border: gpui::transparent_black(),scrollbar_track_background: gpui::transparent_black(),scrollbar_track_border: neutral().light().step_5(),@@ -206,6 +207,7 @@ impl ThemeColors {pane_group_border: neutral().dark().step_6(),scrollbar_thumb_background: neutral().dark_alpha().step_3(),scrollbar_thumb_hover_background: neutral().dark_alpha().step_4(),+ scrollbar_thumb_active_background: neutral().dark_alpha().step_5(),scrollbar_thumb_border: gpui::transparent_black(),scrollbar_track_background: gpui::transparent_black(),scrollbar_track_border: neutral().dark().step_5(),diff --git a/crates/theme/src/fallback_themes.rs b/crates/theme/src/fallback_themes.rsindex 624cb3aabfc..d907da645b5 100644--- a/crates/theme/src/fallback_themes.rs+++ b/crates/theme/src/fallback_themes.rs@@ -190,6 +190,12 @@ pub(crate) fn zed_default_dark() -> Theme {pane_group_border: hsla(225. / 360., 13. / 100., 12. / 100., 1.),scrollbar_thumb_background: gpui::transparent_black(),scrollbar_thumb_hover_background: hsla(225.0 / 360., 11.8 / 100., 26.7 / 100., 1.0),+ scrollbar_thumb_active_background: hsla(+ 225.0 / 360.,+ 11.8 / 100.,+ 26.7 / 100.,+ 1.0,+ ),scrollbar_thumb_border: hsla(228. / 360., 8. / 100., 25. / 100., 1.),scrollbar_track_background: gpui::transparent_black(),scrollbar_track_border: hsla(228. / 360., 8. / 100., 25. / 100., 1.),diff --git a/crates/theme/src/schema.rs b/crates/theme/src/schema.rsindex 551308eafb0..242091d40a0 100644--- a/crates/theme/src/schema.rs+++ b/crates/theme/src/schema.rs@@ -358,6 +358,10 @@ pub struct ThemeColorsContent {#[serde(rename = "scrollbar.thumb.hover_background")]pub scrollbar_thumb_hover_background: Option<String>,+ /// The color of the scrollbar thumb whilst being actively dragged.+ #[serde(rename = "scrollbar.thumb.active_background")]+ pub scrollbar_thumb_active_background: Option<String>,+/// The border color of the scrollbar thumb.#[serde(rename = "scrollbar.thumb.border")]pub scrollbar_thumb_border: Option<String>,@@ -622,6 +626,15 @@ impl ThemeColorsContent {.editor_document_highlight_read_background.as_ref().and_then(|color| try_parse_color(color).ok());+ let scrollbar_thumb_background = self+ .scrollbar_thumb_background+ .as_ref()+ .and_then(|color| try_parse_color(color).ok())+ .or_else(|| {+ self.deprecated_scrollbar_thumb_background+ .as_ref()+ .and_then(|color| try_parse_color(color).ok())+ });ThemeColorsRefinement {border,border_variant: self@@ -805,19 +818,16 @@ impl ThemeColorsContent {.as_ref().and_then(|color| try_parse_color(color).ok()).or(border),- scrollbar_thumb_background: self- .scrollbar_thumb_background- .as_ref()- .and_then(|color| try_parse_color(color).ok())- .or_else(|| {- self.deprecated_scrollbar_thumb_background- .as_ref()- .and_then(|color| try_parse_color(color).ok())- }),+ scrollbar_thumb_background,scrollbar_thumb_hover_background: self.scrollbar_thumb_hover_background.as_ref().and_then(|color| try_parse_color(color).ok()),+ scrollbar_thumb_active_background: self+ .scrollbar_thumb_active_background+ .as_ref()+ .and_then(|color| try_parse_color(color).ok())+ .or(scrollbar_thumb_background),scrollbar_thumb_border: self.scrollbar_thumb_border.as_ref()diff --git a/crates/theme/src/styles/colors.rs b/crates/theme/src/styles/colors.rsindex 0310ca698ca..3d0df279852 100644--- a/crates/theme/src/styles/colors.rs+++ b/crates/theme/src/styles/colors.rs@@ -135,6 +135,8 @@ pub struct ThemeColors {pub scrollbar_thumb_background: Hsla,/// The color of the scrollbar thumb when hovered over.pub scrollbar_thumb_hover_background: Hsla,+ /// The color of the scrollbar thumb whilst being actively dragged.+ pub scrollbar_thumb_active_background: Hsla,/// The border color of the scrollbar thumb.pub scrollbar_thumb_border: Hsla,/// The background color of the scrollbar track.@@ -321,6 +323,7 @@ pub enum ThemeColorField {PaneGroupBorder,ScrollbarThumbBackground,ScrollbarThumbHoverBackground,+ ScrollbarThumbActiveBackground,ScrollbarThumbBorder,ScrollbarTrackBackground,ScrollbarTrackBorder,@@ -428,6 +431,9 @@ impl ThemeColors {ThemeColorField::PaneGroupBorder => self.pane_group_border,ThemeColorField::ScrollbarThumbBackground => self.scrollbar_thumb_background,ThemeColorField::ScrollbarThumbHoverBackground => self.scrollbar_thumb_hover_background,+ ThemeColorField::ScrollbarThumbActiveBackground => {+ self.scrollbar_thumb_active_background+ }ThemeColorField::ScrollbarThumbBorder => self.scrollbar_thumb_border,ThemeColorField::ScrollbarTrackBackground => self.scrollbar_track_background,ThemeColorField::ScrollbarTrackBorder => self.scrollbar_track_border,diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rsindex 85ebe037678..99f76258969 100644--- a/crates/theme_importer/src/vscode/converter.rs+++ b/crates/theme_importer/src/vscode/converter.rs@@ -167,6 +167,10 @@ impl VsCodeThemeConverter {.scrollbar_slider.hover_background.clone(),+ scrollbar_thumb_active_background: vscode_colors+ .scrollbar_slider+ .active_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(),