From dbe969893c061084c67224cd8eb3d6e0de6ee4c1 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 25 Jan 2022 12:31:55 -0800 Subject: [PATCH] Show icons and counts in the project diagnostics tab Co-Authored-By: Nathan Sobo --- crates/diagnostics/src/diagnostics.rs | 4 ++-- crates/editor/src/items.rs | 23 ++++--------------- .../assets/icons/diagnostic-summary-error.svg | 3 +++ .../icons/diagnostic-summary-warning.svg | 3 +++ crates/zed/assets/icons/no.svg | 4 ---- crates/zed/assets/icons/warning.svg | 3 --- crates/zed/assets/themes/_base.toml | 4 ++-- 7 files changed, 15 insertions(+), 29 deletions(-) create mode 100644 crates/zed/assets/icons/diagnostic-summary-error.svg create mode 100644 crates/zed/assets/icons/diagnostic-summary-warning.svg delete mode 100644 crates/zed/assets/icons/no.svg delete mode 100644 crates/zed/assets/icons/warning.svg diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs index a6c351002dfaf300d752a2e1718e4628728b71ea..ba3043871f3dd471d3f8727890c1bf577fa7bb52 100644 --- a/crates/diagnostics/src/diagnostics.rs +++ b/crates/diagnostics/src/diagnostics.rs @@ -563,7 +563,7 @@ impl workspace::ItemView for ProjectDiagnosticsEditor { let summary_spacing = theme.tab_summary_spacing; Flex::row() .with_children([ - Svg::new("icons/no.svg") + Svg::new("icons/diagnostic-summary-error.svg") .with_color(style.label.text.color) .constrained() .with_width(icon_width) @@ -574,7 +574,7 @@ impl workspace::ItemView for ProjectDiagnosticsEditor { Label::new(self.summary.error_count.to_string(), style.label.clone()) .aligned() .boxed(), - Svg::new("icons/warning.svg") + Svg::new("icons/diagnostic-summary-warning.svg") .with_color(style.label.text.color) .constrained() .with_width(icon_width) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 82a398f6bec6e4ec4d500af7bccb8db8702d74e4..3e05fcff431217315c673adc403d06f402faf802 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -330,24 +330,11 @@ impl View for DiagnosticMessage { fn render(&mut self, _: &mut RenderContext) -> ElementBox { if let Some(diagnostic) = &self.diagnostic { let theme = &self.settings.borrow().theme.workspace.status_bar; - Flex::row() - .with_child( - Svg::new("icons/warning.svg") - .with_color(theme.diagnostic_icon_color) - .constrained() - .with_height(theme.diagnostic_icon_size) - .contained() - .with_margin_right(theme.diagnostic_icon_spacing) - .boxed(), - ) - .with_child( - Label::new( - diagnostic.message.lines().next().unwrap().to_string(), - theme.diagnostic_message.clone(), - ) - .boxed(), - ) - .boxed() + Label::new( + diagnostic.message.lines().next().unwrap().to_string(), + theme.diagnostic_message.clone(), + ) + .boxed() } else { Empty::new().boxed() } diff --git a/crates/zed/assets/icons/diagnostic-summary-error.svg b/crates/zed/assets/icons/diagnostic-summary-error.svg new file mode 100644 index 0000000000000000000000000000000000000000..0180762a9eddb2e47e9a75d7c005e0d18c3dc04f --- /dev/null +++ b/crates/zed/assets/icons/diagnostic-summary-error.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/zed/assets/icons/diagnostic-summary-warning.svg b/crates/zed/assets/icons/diagnostic-summary-warning.svg new file mode 100644 index 0000000000000000000000000000000000000000..fead4db839ec0875a6ee284b95c3e413b5fc9045 --- /dev/null +++ b/crates/zed/assets/icons/diagnostic-summary-warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/zed/assets/icons/no.svg b/crates/zed/assets/icons/no.svg deleted file mode 100644 index 799a6dcc0fc8e243bbb89bd11b5e556194c7d9be..0000000000000000000000000000000000000000 --- a/crates/zed/assets/icons/no.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/crates/zed/assets/icons/warning.svg b/crates/zed/assets/icons/warning.svg deleted file mode 100644 index 845d07a15ae8ca3abbcfaaf4feaabfc623117eff..0000000000000000000000000000000000000000 --- a/crates/zed/assets/icons/warning.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/zed/assets/themes/_base.toml b/crates/zed/assets/themes/_base.toml index 37c878969ca4e8d3e283a726b6b2dcb1f7f87a83..42a4aa0372a9192a9a1ff9b2ef6e0c78c8e07987 100644 --- a/crates/zed/assets/themes/_base.toml +++ b/crates/zed/assets/themes/_base.toml @@ -316,6 +316,6 @@ message.highlight_text.color = "$text.3.color" background = "$surface.1" empty_message = "$text.0" status_bar_item = { extends = "$text.2", margin.right = 10 } -tab_icon_width = 9 -tab_icon_spacing = 3 +tab_icon_width = 13 +tab_icon_spacing = 4 tab_summary_spacing = 10