Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix label color for inactive tabs (#3899)
Marshall Bowers47476faef1e0
diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rsindex 77e6a7673ff..9d5a62cff19 100644--- a/crates/diagnostics/src/diagnostics.rs+++ b/crates/diagnostics/src/diagnostics.rs@@ -641,8 +641,13 @@ impl Item for ProjectDiagnosticsEditor {fn tab_content(&self, _detail: Option<usize>, selected: bool, _: &WindowContext) -> AnyElement {if self.summary.error_count == 0 && self.summary.warning_count == 0 {- let label = Label::new("No problems");- label.into_any_element()+ Label::new("No problems")+ .color(if selected {+ Color::Default+ } else {+ Color::Muted+ })+ .into_any_element()} else {h_stack().gap_1()diff --git a/crates/language_tools/src/lsp_log.rs b/crates/language_tools/src/lsp_log.rsindex e38de7d3734..123149eae2e 100644--- a/crates/language_tools/src/lsp_log.rs+++ b/crates/language_tools/src/lsp_log.rs@@ -10,7 +10,7 @@ use language::{LanguageServerId, LanguageServerName};use lsp::IoKind;use project::{search::SearchQuery, Project};use std::{borrow::Cow, sync::Arc};-use ui::{h_stack, popover_menu, Button, Checkbox, Clickable, ContextMenu, Label, Selection};+use ui::{popover_menu, prelude::*, Button, Checkbox, ContextMenu, Label, Selection};use workspace::{item::{Item, ItemHandle},searchable::{SearchEvent, SearchableItem, SearchableItemHandle},@@ -614,8 +614,14 @@ impl Item for LspLogView {Editor::to_item_events(event, f)}- fn tab_content(&self, _: Option<usize>, _: bool, _: &WindowContext<'_>) -> AnyElement {- Label::new("LSP Logs").into_any_element()+ fn tab_content(&self, _: Option<usize>, selected: bool, _: &WindowContext<'_>) -> AnyElement {+ Label::new("LSP Logs")+ .color(if selected {+ Color::Default+ } else {+ Color::Muted+ })+ .into_any_element()}fn as_searchable(&self, handle: &View<Self>) -> Option<Box<dyn SearchableItemHandle>> {diff --git a/crates/language_tools/src/syntax_tree_view.rs b/crates/language_tools/src/syntax_tree_view.rsindex a36264261e8..c30564e9bfe 100644--- a/crates/language_tools/src/syntax_tree_view.rs+++ b/crates/language_tools/src/syntax_tree_view.rs@@ -405,8 +405,14 @@ impl Item for SyntaxTreeView {fn to_item_events(_: &Self::Event, _: impl FnMut(workspace::item::ItemEvent)) {}- fn tab_content(&self, _: Option<usize>, _: bool, _: &WindowContext<'_>) -> AnyElement {- Label::new("Syntax Tree").into_any_element()+ fn tab_content(&self, _: Option<usize>, selected: bool, _: &WindowContext<'_>) -> AnyElement {+ Label::new("Syntax Tree")+ .color(if selected {+ Color::Default+ } else {+ Color::Muted+ })+ .into_any_element()}fn clone_on_split(