diff --git a/src/app/file_list.rs b/src/app/file_list.rs index 92ff275..ca1ab1b 100644 --- a/src/app/file_list.rs +++ b/src/app/file_list.rs @@ -164,13 +164,11 @@ impl App { /// editor rather than leaving an empty column. pub(super) fn left_pane(&mut self, ctx: &egui::Context) { let show_files = self.config.show_file_panel; - if show_files { - let panel = egui::SidePanel::left("files") - .resizable(true) - .default_width(self.config.file_panel_width) - .width_range(260.0..=600.0); - - let response = panel.show(ctx, |ui| { + if let Some(response) = egui::SidePanel::left("files") + .resizable(true) + .default_width(self.config.file_panel_width) + .width_range(260.0..=600.0) + .show_animated(ctx, show_files, |ui| { // The default theme renders unselected list rows fairly dim; bump // the widget text colours so file names stay legible (especially in // dark mode) without affecting the rest of the app. @@ -605,9 +603,8 @@ impl App { } }); } - }); - - // Update the config with the current panel width if it changed + }) { + // Update the config with the current panel width let new_width = response.response.rect.width(); if (new_width - self.config.file_panel_width).abs() > 0.1 { self.config.file_panel_width = new_width;