From 06987edadb8ad13ab44908138836070990aa7110 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:54:56 +0200 Subject: [PATCH] project panel: Fix alignment of entries overflowing the panel. (#10676) With file icons turned off, we still reserve space for an icon and make it invisible. However, that space was marked as flex, which made it shrink in case subsequent file name could not fit in the current width of the project panel. Fixes #10622 https://github.com/zed-industries/zed/assets/24362066/d565a03a-3712-49d1-bf52-407e4508a8cf Release Notes: - Fixed project panel entries misalignment with narrow panel & file icons turned off. --- crates/project_panel/src/project_panel.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 6e0aeb870cc08f31ff384cf46e1b20db153c1662..5a57fbfbcdf9c985d6ff3dddeead75f4cb50486b 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -1642,7 +1642,10 @@ impl ProjectPanel { .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() + h_flex() + .size(IconSize::default().rems()) + .invisible() + .flex_none() }) .child( if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) {