Skip to content

Commit

Permalink
Make sure the progressbar does not get stuck before setting itself to…
Browse files Browse the repository at this point in the history
… 100%
  • Loading branch information
salihgerdan committed Aug 10, 2023
1 parent 8b8ada5 commit 69dcb2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/progressbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ use gtk::prelude::*;
use std::sync::atomic::Ordering;

fn progressbar_refresh(widget: &gtk::ProgressBar, scan: &Scan) -> Continue {
// measure complete beforehand so we do not fall behind and send Continue(false) prematurely
let complete = scan.complete.load(Ordering::SeqCst);
widget.set_fraction(scan.progress());
Continue(!scan.complete.load(Ordering::SeqCst))
Continue(!complete)
}

pub fn start_progressbar_timer(widget: &gtk::ProgressBar, scan: Scan) {
Expand Down

0 comments on commit 69dcb2f

Please sign in to comment.