Render an empty placeholder when not showing file icons in the project panel (#3897)

This PR makes it so when we're not showing file icons in the project
panel we render an empty placeholder instead of nothing.

This prevents the indentation of the items in the file tree from
changing based on the presence of the icon.

Release Notes:

- Fixed layout shift when `project_panel.file_icons` is set to `false`.
This commit is contained in:
Marshall Bowers
2024-01-04 17:10:08 -05:00
committed by GitHub
parent 5e3d4885bf
commit 32cd4d778a
+1 -1
View File
@@ -1395,7 +1395,7 @@ impl ProjectPanel {
.child(if let Some(icon) = &icon {
div().child(IconElement::from_path(icon.to_string()).color(Color::Muted))
} else {
div()
div().size(IconSize::default().rems()).invisible()
})
.child(
if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) {