diff options
Diffstat (limited to 'client/src/download.rs')
-rw-r--r-- | client/src/download.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/client/src/download.rs b/client/src/download.rs index bcdd80e..4e2f0aa 100644 --- a/client/src/download.rs +++ b/client/src/download.rs @@ -16,6 +16,7 @@ */ use crate::network::Network; use anyhow::Result; +use egui::{Grid, Widget}; use log::debug; use std::{collections::HashSet, marker::PhantomData, sync::RwLock}; use weareshared::{ @@ -100,3 +101,23 @@ impl Downloader { Ok(()) } } + +impl Widget for &Downloader { + fn ui(self, ui: &mut egui::Ui) -> egui::Response { + let state = self.inner.read().unwrap(); + Grid::new("dl") + .num_columns(2) + .show(ui, |ui| { + ui.label("Need"); + ui.label(state.need.len().to_string()); + ui.end_row(); + ui.label("Pending"); + ui.label(state.pending.len().to_string()); + ui.end_row(); + ui.label("Have"); + ui.label(state.have.len().to_string()); + ui.end_row(); + }) + .response + } +} |