From 659ea7054a8b5c6da366301f89349b8f2979a14b Mon Sep 17 00:00:00 2001 From: Hans Date: Thu, 28 Mar 2024 23:44:15 +0800 Subject: [PATCH] Adjust image viewer tab title font (#9903) Fix #9895 Release notes: - Changed the tab title of the image preview to be the same as the other tabs ([#9895](https://github.com/zed-industries/zed/issues/9895)). --------- Co-authored-by: Marshall Bowers --- crates/image_viewer/src/image_viewer.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/image_viewer/src/image_viewer.rs b/crates/image_viewer/src/image_viewer.rs index d77389098a..d9a30c9e77 100644 --- a/crates/image_viewer/src/image_viewer.rs +++ b/crates/image_viewer/src/image_viewer.rs @@ -73,14 +73,21 @@ impl Item for ImageView { fn tab_content( &self, _detail: Option, - _selected: bool, + selected: bool, _cx: &WindowContext, ) -> AnyElement { - self.path + let title = self + .path .file_name() .unwrap_or_else(|| self.path.as_os_str()) .to_string_lossy() - .to_string() + .to_string(); + Label::new(title) + .color(if selected { + Color::Default + } else { + Color::Muted + }) .into_any_element() }