From 64ea74d1db761e480361214d983e6676b47d5dc2 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 29 Mar 2024 12:55:31 -0400 Subject: [PATCH] Fix vertical alignment of labels in file tree (#9959) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes the vertical alignment of the labels in the file tree in the project panel. This appears to have been introduced in https://github.com/zed-industries/zed/pull/8988 through the addition of the `.h_6` in conjunction with a `div`, causing the contents to not be vertically aligned. ### Before Screenshot 2024-03-29 at 12 44 15 PM ### After Screenshot 2024-03-29 at 12 44 42 PM Release Notes: - Fixed the vertical alignment of labels in the file tree to better align with the file icons. --- crates/project_panel/src/project_panel.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 771118b509..c86fcaa7b2 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -1435,15 +1435,15 @@ impl ProjectPanel { .indent_step_size(px(settings.indent_size)) .selected(is_selected) .child(if let Some(icon) = &icon { - div().child(Icon::from_path(icon.to_string()).color(filename_text_color)) + h_flex().child(Icon::from_path(icon.to_string()).color(filename_text_color)) } else { - div().size(IconSize::default().rems()).invisible() + h_flex().size(IconSize::default().rems()).invisible() }) .child( if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) { h_flex().h_6().w_full().child(editor.clone()) } else { - div() + h_flex() .h_6() .child(Label::new(file_name).color(filename_text_color)) }