Add custom workflow operation toggles, improve output step summary
Workflow step: replace the auto-advancing Custom card with a proper operation checklist using SwitchRow toggles for each operation (Resize, Adjustments, Convert, Compress, Metadata, Watermark, Rename). Wired to job config so selections persist through the wizard. Output step: show actual file size alongside image count. Refresh both count and size dynamically when navigating to the output step.
This commit is contained in:
@@ -527,14 +527,20 @@ fn navigate_to_step(ui: &WizardUi, target: usize) {
|
||||
|
||||
// Update dynamic content on certain steps
|
||||
if target == 9 {
|
||||
// Output step - update image count and operation summary
|
||||
let count = ui.state.loaded_files.borrow().len();
|
||||
// Output step - update image count, total size, and operation summary
|
||||
let files = ui.state.loaded_files.borrow();
|
||||
let count = files.len();
|
||||
let total_size: u64 = files.iter()
|
||||
.filter_map(|p| std::fs::metadata(p).ok())
|
||||
.map(|m| m.len())
|
||||
.sum();
|
||||
drop(files);
|
||||
if let Some(page) = ui.pages.get(9) {
|
||||
walk_widgets(&page.child(), &|widget| {
|
||||
if let Some(row) = widget.downcast_ref::<adw::ActionRow>()
|
||||
&& row.title().as_str() == "Images to process"
|
||||
{
|
||||
row.set_subtitle(&format!("{} images", count));
|
||||
row.set_subtitle(&format!("{} images ({})", count, format_bytes(total_size)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user