From ee6a40137f21998a1b82df480c81207ec569fc98 Mon Sep 17 00:00:00 2001 From: Uladzislau Kaminski Date: Tue, 13 Aug 2024 10:09:13 +0100 Subject: [PATCH] Remove extra empty space for files when file icons are turned off (#16142) Closes #16073 image Release Notes: - Removed extra empty space for files when file icons are turned off ([#16073](https://github.com/zed-industries/zed/issues/16073)) --- crates/project_panel/src/project_panel.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index d4fa0eff41..d5b466b933 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -2120,13 +2120,12 @@ impl ProjectPanel { .into_any_element(), ) }) - .child(if let Some(icon) = &icon { - h_flex().child(Icon::from_path(icon.to_string()).color(filename_text_color)) - } else { - h_flex() - .size(IconSize::default().rems()) - .invisible() - .flex_none() + .when_some(icon, |this, icon| { + this.child( + h_flex().child( + Icon::from_path(icon.to_string()).color(filename_text_color), + ), + ) }) .child( if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) {