summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-04-24 14:00:47 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-04-24 14:07:40 -0400
commit18a5b367246f04955ee64e938033437295f045ad (patch)
treebbbd95f56785aa3d66a48bb22afad770c5060435 /src/ui
parent6fc3a3c7dc73215cb1b4b3a20222891ae0c605cb (diff)
paste jobs now have an accurate number of items to paste
- before pasting, joshuto will traverse the paths to determine the total number of files that will need to be copied
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/widgets/tui_worker.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/widgets/tui_worker.rs b/src/ui/widgets/tui_worker.rs
index a92f34c..9f6d258 100644
--- a/src/ui/widgets/tui_worker.rs
+++ b/src/ui/widgets/tui_worker.rs
@@ -28,7 +28,7 @@ impl<'a> Widget for TuiWorker<'a> {
let msg = format!(
"{} ({}/{}) {:?}",
op_str,
- progress.index() + 1,
+ progress.completed() + 1,
progress.len(),
io_obs.dest_path()
);
@@ -36,7 +36,7 @@ impl<'a> Widget for TuiWorker<'a> {
buf.set_stringn(0, 2, msg, area.width as usize, style);
// draw a progress bar
- let progress_bar_width = (progress.index() as f32 / progress.len() as f32
+ let progress_bar_width = (progress.completed() as f32 / progress.len() as f32
* area.width as f32) as usize;
let progress_bar_space = " ".repeat(progress_bar_width);
let style = Style::default().bg(Color::Blue);