diff options
author | Rupert Rutledge <eosis2 [at] gmail.com> | 2020-04-26 20:30:14 +0100 |
---|---|---|
committer | Rupert Rutledge <eosis2 [at] gmail.com> | 2020-04-26 20:30:14 +0100 |
commit | 4844693ceac387fddfe18b01f9b975626ae47619 (patch) | |
tree | 53d5c063609155ccdc300a1c41cfdd818a0c3ca4 /src/display | |
parent | 265390b574c350be24c95e67a9ea733a1134e889 (diff) |
Running cargo fmt
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/components/layout.rs | 2 | ||||
-rw-r--r-- | src/display/components/total_bandwidth.rs | 12 | ||||
-rw-r--r-- | src/display/ui.rs | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/display/components/layout.rs b/src/display/components/layout.rs index c86211a..6c9812d 100644 --- a/src/display/components/layout.rs +++ b/src/display/components/layout.rs @@ -2,9 +2,9 @@ use ::tui::backend::Backend; use ::tui::layout::{Constraint, Direction, Rect}; use ::tui::terminal::Frame; +use super::HeaderDetails; use super::HelpText; use super::Table; -use super::HeaderDetails; const FIRST_HEIGHT_BREAKPOINT: u16 = 30; const FIRST_WIDTH_BREAKPOINT: u16 = 120; diff --git a/src/display/components/total_bandwidth.rs b/src/display/components/total_bandwidth.rs index a1968e5..095247b 100644 --- a/src/display/components/total_bandwidth.rs +++ b/src/display/components/total_bandwidth.rs @@ -46,8 +46,8 @@ impl<'a> HeaderDetails<'a> { }; Paragraph::new(title_text.iter()) - .alignment(Alignment::Left) - .render(frame, rect); + .alignment(Alignment::Left) + .render(frame, rect); } fn render_elapsed_time(&self, frame: &mut Frame<impl Backend>, rect: Rect) { @@ -59,11 +59,11 @@ impl<'a> HeaderDetails<'a> { self.elapsed_time.as_secs() % 60 ), Style::default() - .fg(Color::LightBlue) - .modifier(Modifier::BOLD), + .fg(Color::LightBlue) + .modifier(Modifier::BOLD), )]; Paragraph::new(elapsed_time_text.iter()) - .alignment(Alignment::Right) - .render(frame, rect); + .alignment(Alignment::Right) + .render(frame, rect); } } diff --git a/src/display/ui.rs b/src/display/ui.rs index 21ae49d..54db7fb 100644 --- a/src/display/ui.rs +++ b/src/display/ui.rs @@ -3,7 +3,7 @@ use ::std::collections::HashMap; use ::tui::backend::Backend; use ::tui::Terminal; -use crate::display::components::{HelpText, Layout, Table, HeaderDetails}; +use crate::display::components::{HeaderDetails, HelpText, Layout, Table}; use crate::display::UIState; use crate::network::{display_connection_string, display_ip_or_host, LocalSocket, Utilization}; @@ -79,6 +79,7 @@ where )); } } + pub fn draw(&mut self, paused: bool, show_dns: bool, elapsed_time: std::time::Duration) { let state = &self.state; let children = self.get_tables_to_display(); |