Remove extra empty space for files when file icons are turned off (#16142)

Closes #16073

<img width="269" alt="image" src="https://github.com/user-attachments/assets/88b7ff9f-17ec-4764-b37a-c218d7ad14ec">

Release Notes:

- Removed extra empty space for files when file icons are turned off ([#16073](https://github.com/zed-industries/zed/issues/16073))
This commit is contained in:
Uladzislau Kaminski 2024-08-13 10:09:13 +01:00 committed by GitHub
parent 1c189e82a0
commit ee6a40137f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2120,13 +2120,12 @@ impl ProjectPanel {
.into_any_element(), .into_any_element(),
) )
}) })
.child(if let Some(icon) = &icon { .when_some(icon, |this, icon| {
h_flex().child(Icon::from_path(icon.to_string()).color(filename_text_color)) this.child(
} else { h_flex().child(
h_flex() Icon::from_path(icon.to_string()).color(filename_text_color),
.size(IconSize::default().rems()) ),
.invisible() )
.flex_none()
}) })
.child( .child(
if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) { if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) {