diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2021-05-23 18:51:35 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2021-08-23 16:55:27 -0400 |
commit | f73ea0da365efa35be31379d799a2a9f07bfc38f (patch) | |
tree | d97752e0e5f0de4e936b320f8a94f7b36973aed1 /src/canvas.rs | |
parent | d1e672f26329a6483608ccd61a55f1e33f9662da (diff) |
refactor: Start state refactor
Diffstat (limited to 'src/canvas.rs')
-rw-r--r-- | src/canvas.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/canvas.rs b/src/canvas.rs index 79118e3b..55bbe968 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -13,14 +13,13 @@ use tui::{ use canvas_colours::*; use dialogs::*; -use screens::*; use widgets::*; use crate::{ app::{ self, layout_manager::{BottomColRow, BottomLayout, BottomWidgetType}, - App, + AppState, }, constants::*, data_conversion::{ConvertedBatteryData, ConvertedCpuData, ConvertedProcessData}, @@ -33,7 +32,6 @@ use crate::{ mod canvas_colours; mod dialogs; mod drawing_utils; -mod screens; mod widgets; /// Point is of time, data @@ -299,7 +297,7 @@ impl Painter { } pub fn draw_data<B: Backend>( - &mut self, terminal: &mut Terminal<B>, app_state: &mut app::App, + &mut self, terminal: &mut Terminal<B>, app_state: &mut app::AppState, ) -> error::Result<()> { use BottomWidgetType::*; @@ -521,13 +519,6 @@ impl Painter { ), _ => {} } - } else if app_state.is_config_open { - let rect = Layout::default() - .margin(0) - .constraints([Constraint::Percentage(100)]) - .split(f.size())[0]; - - self.draw_config_screen(&mut f, app_state, rect) } else if app_state.app_config_fields.use_basic_mode { // Basic mode. This basically removes all graphs but otherwise // the same info. @@ -701,7 +692,7 @@ impl Painter { &mut f, app_state, widgets, - &widget_draw_locs, + widget_draw_locs, ); }); } @@ -715,7 +706,7 @@ impl Painter { } fn draw_widgets_with_constraints<B: Backend>( - &self, f: &mut Frame<'_, B>, app_state: &mut App, widgets: &BottomColRow, + &self, f: &mut Frame<'_, B>, app_state: &mut AppState, widgets: &BottomColRow, widget_draw_locs: &[Rect], ) { use BottomWidgetType::*; |