Skip to content

Commit

Permalink
Tweak progress output.
Browse files Browse the repository at this point in the history
1. Mark steps completed when they end.
2. Clear the message when done, for a given resolution.
  • Loading branch information
lgarron committed Apr 10, 2023
1 parent f89de6d commit 543398a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/icon_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ pub struct IconInputs {
}

impl IconConversion {
fn step_unincremented(&self, step_desciption: &str) {
if let Some(progress_bar) = &self.progress_bar {
progress_bar.set_message(step_desciption.to_owned());
}
}

fn step(&self, step_desciption: &str) {
if let Some(progress_bar) = &self.progress_bar {
progress_bar.set_message(step_desciption.to_owned());
Expand Down Expand Up @@ -427,6 +433,8 @@ impl IconConversion {
args.push_path(output_path);
run_convert(&args, Some(template_icon))?;

self.step("");

Ok(())
}

Expand All @@ -445,7 +453,7 @@ impl IconConversion {
let size = inputs.resolution.size();
let offset_y = inputs.resolution.offset_y();

self.step("Sizing mask");
self.step_unincremented("Sizing mask");
let sized_mask_path = self
.sized_mask(
full_mask_path,
Expand Down

0 comments on commit 543398a

Please sign in to comment.