diff --git a/pixstrip-gtk/src/app.rs b/pixstrip-gtk/src/app.rs index 83b3b54..aa65395 100644 --- a/pixstrip-gtk/src/app.rs +++ b/pixstrip-gtk/src/app.rs @@ -569,18 +569,21 @@ fn navigate_to_step(ui: &WizardUi, target: usize) { if target == 9 { // Output step - update image count, total size, and operation summary let files = ui.state.loaded_files.borrow(); - let count = files.len(); + let excluded = ui.state.excluded_files.borrow(); + let included_count = files.iter().filter(|p| !excluded.contains(*p)).count(); let total_size: u64 = files.iter() + .filter(|p| !excluded.contains(*p)) .filter_map(|p| std::fs::metadata(p).ok()) .map(|m| m.len()) .sum(); + drop(excluded); drop(files); if let Some(page) = ui.pages.get(9) { walk_widgets(&page.child(), &|widget| { if let Some(row) = widget.downcast_ref::() && row.title().as_str() == "Images to process" { - row.set_subtitle(&format!("{} images ({})", count, format_bytes(total_size))); + row.set_subtitle(&format!("{} images ({})", included_count, format_bytes(total_size))); } }); } diff --git a/pixstrip-gtk/src/steps/step_output.rs b/pixstrip-gtk/src/steps/step_output.rs index 598b6d0..b604716 100644 --- a/pixstrip-gtk/src/steps/step_output.rs +++ b/pixstrip-gtk/src/steps/step_output.rs @@ -97,15 +97,20 @@ pub fn build_output_page(state: &AppState) -> adw::NavigationPage { .title("Batch Info") .build(); - let file_count = state.loaded_files.borrow().len(); - let total_size: u64 = state.loaded_files.borrow().iter() + let excluded = state.excluded_files.borrow(); + let files = state.loaded_files.borrow(); + let included_count = files.iter().filter(|p| !excluded.contains(*p)).count(); + let total_size: u64 = files.iter() + .filter(|p| !excluded.contains(*p)) .filter_map(|p| std::fs::metadata(p).ok()) .map(|m| m.len()) .sum(); + drop(files); + drop(excluded); let count_row = adw::ActionRow::builder() .title("Images to process") - .subtitle(format!("{} images ({})", file_count, format_size(total_size))) + .subtitle(format!("{} images ({})", included_count, format_size(total_size))) .build(); count_row.add_prefix(>k::Image::from_icon_name("image-x-generic-symbolic"));