diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.rs | 3 | ||||
-rw-r--r-- | src/app/states.rs | 8 | ||||
-rw-r--r-- | src/canvas/dialogs/dd_dialog.rs | 3 | ||||
-rw-r--r-- | src/canvas/widgets/cpu_graph.rs | 3 | ||||
-rw-r--r-- | src/components/time_graph.rs | 1 | ||||
-rw-r--r-- | src/components/tui_widget/time_chart.rs | 1 | ||||
-rw-r--r-- | src/data_conversion.rs | 10 | ||||
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/options.rs | 13 | ||||
-rw-r--r-- | src/widgets.rs (renamed from src/app/widgets.rs) | 2 | ||||
-rw-r--r-- | src/widgets/battery_widget.rs (renamed from src/app/widgets/battery_widget.rs) | 0 | ||||
-rw-r--r-- | src/widgets/cpu_graph.rs (renamed from src/app/widgets/cpu_graph.rs) | 0 | ||||
-rw-r--r-- | src/widgets/disk_table.rs (renamed from src/app/widgets/disk_table.rs) | 0 | ||||
-rw-r--r-- | src/widgets/mem_graph.rs (renamed from src/app/widgets/mem_graph.rs) | 0 | ||||
-rw-r--r-- | src/widgets/net_graph.rs (renamed from src/app/widgets/net_graph.rs) | 0 | ||||
-rw-r--r-- | src/widgets/process_table.rs (renamed from src/app/widgets/process_table.rs) | 2 | ||||
-rw-r--r-- | src/widgets/process_table/proc_widget_column.rs (renamed from src/app/widgets/process_table/proc_widget_column.rs) | 0 | ||||
-rw-r--r-- | src/widgets/process_table/proc_widget_data.rs (renamed from src/app/widgets/process_table/proc_widget_data.rs) | 0 | ||||
-rw-r--r-- | src/widgets/process_table/sort_table.rs (renamed from src/app/widgets/process_table/sort_table.rs) | 0 | ||||
-rw-r--r-- | src/widgets/temperature_table.rs (renamed from src/app/widgets/temperature_table.rs) | 0 |
20 files changed, 23 insertions, 24 deletions
@@ -13,7 +13,7 @@ use typed_builder::*; use unicode_segmentation::{GraphemeCursor, UnicodeSegmentation}; use unicode_width::{UnicodeWidthChar, UnicodeWidthStr}; -use self::widgets::{ProcWidget, ProcWidgetMode}; +use crate::widgets::{ProcWidget, ProcWidgetMode}; use crate::{ constants, data_conversion::ConvertedData, @@ -29,7 +29,6 @@ pub mod layout_manager; mod process_killer; pub mod query; pub mod states; -pub mod widgets; use frozen_state::FrozenState; diff --git a/src/app/states.rs b/src/app/states.rs index 4c3e6e28..a24a52f1 100644 --- a/src/app/states.rs +++ b/src/app/states.rs @@ -2,13 +2,13 @@ use std::{collections::HashMap, time::Instant}; use unicode_segmentation::GraphemeCursor; -use super::widgets::{ - BatteryWidgetState, CpuWidgetState, DiskTableWidget, MemWidgetState, NetWidgetState, - ProcWidget, TempWidgetState, -}; use crate::{ app::{layout_manager::BottomWidgetType, query::*}, constants, + widgets::{ + BatteryWidgetState, CpuWidgetState, DiskTableWidget, MemWidgetState, NetWidgetState, + ProcWidget, TempWidgetState, + }, }; #[derive(Debug)] diff --git a/src/canvas/dialogs/dd_dialog.rs b/src/canvas/dialogs/dd_dialog.rs index 00383546..ff78e9f6 100644 --- a/src/canvas/dialogs/dd_dialog.rs +++ b/src/canvas/dialogs/dd_dialog.rs @@ -10,8 +10,9 @@ use tui::{ }; use crate::{ - app::{widgets::ProcWidgetMode, App, KillSignal}, + app::{App, KillSignal}, canvas::Painter, + widgets::ProcWidgetMode, }; const DD_BASE: &str = " Confirm Kill Process ── Esc to close "; diff --git a/src/canvas/widgets/cpu_graph.rs b/src/canvas/widgets/cpu_graph.rs index 6cf09ea1..bb996e0d 100644 --- a/src/canvas/widgets/cpu_graph.rs +++ b/src/canvas/widgets/cpu_graph.rs @@ -8,13 +8,14 @@ use tui::{ }; use crate::{ - app::{layout_manager::WidgetDirection, widgets::CpuWidgetState, App}, + app::{layout_manager::WidgetDirection, App}, canvas::{drawing_utils::should_hide_x_label, Painter}, components::{ data_table::{DrawInfo, SelectionState}, time_graph::{GraphData, TimeGraph}, }, data_conversion::CpuWidgetData, + widgets::CpuWidgetState, }; const AVG_POSITION: usize = 1; diff --git a/src/components/time_graph.rs b/src/components/time_graph.rs index d6f409e2..26ef1d72 100644 --- a/src/components/time_graph.rs +++ b/src/components/time_graph.rs @@ -130,6 +130,7 @@ impl<'a> TimeGraph<'a> { let y_axis = self.generate_y_axis(); // This is some ugly manual loop unswitching. Maybe unnecessary. + // TODO: Optimize this step. Cut out unneeded points. let data = if self.use_dot { graph_data .iter() diff --git a/src/components/tui_widget/time_chart.rs b/src/components/tui_widget/time_chart.rs index eb04763c..730c3076 100644 --- a/src/components/tui_widget/time_chart.rs +++ b/src/components/tui_widget/time_chart.rs @@ -422,6 +422,7 @@ impl<'a> Widget for TimeChart<'a> { } } + // Probably better to move the dataset inside. for dataset in &self.datasets { Canvas::default() .background_color(self.style.bg.unwrap_or(Color::Reset)) diff --git a/src/data_conversion.rs b/src/data_conversion.rs index 4a529d71..2ce66e98 100644 --- a/src/data_conversion.rs +++ b/src/data_conversion.rs @@ -3,15 +3,15 @@ use kstring::KString; -use crate::app::data_farmer::DataCollection; -use crate::app::data_harvester::cpu::CpuDataType; use crate::app::{ - data_harvester::temperature::TemperatureType, - widgets::{DiskWidgetData, TempWidgetData}, + data_farmer::DataCollection, + data_harvester::{cpu::CpuDataType, temperature::TemperatureType}, + AxisScaling, }; use crate::components::tui_widget::time_chart::Point; +use crate::units::data_units::DataUnit; use crate::utils::gen_util::*; -use crate::{app::AxisScaling, units::data_units::DataUnit}; +use crate::widgets::{DiskWidgetData, TempWidgetData}; #[derive(Default, Debug)] pub struct ConvertedBatteryData { @@ -61,6 +61,7 @@ pub mod constants; pub mod data_conversion; pub mod options; pub mod units; +pub mod widgets; #[cfg(target_family = "windows")] pub type Pid = usize; diff --git a/src/options.rs b/src/options.rs index b7fa777f..8a07d6b1 100644 --- a/src/options.rs +++ b/src/options.rs @@ -13,18 +13,15 @@ use serde::{Deserialize, Serialize}; use typed_builder::*; use crate::{ - app::{ - layout_manager::*, - widgets::{ - BatteryWidgetState, CpuWidgetState, DiskTableWidget, MemWidgetState, NetWidgetState, - ProcWidget, ProcWidgetMode, TempWidgetState, - }, - *, - }, + app::{layout_manager::*, *}, canvas::{canvas_colours::CanvasColours, ColourScheme}, constants::*, units::data_units::DataUnit, utils::error::{self, BottomError}, + widgets::{ + BatteryWidgetState, CpuWidgetState, DiskTableWidget, MemWidgetState, NetWidgetState, + ProcWidget, ProcWidgetMode, TempWidgetState, + }, }; pub mod layout_options; diff --git a/src/app/widgets.rs b/src/widgets.rs index 2a00fa38..8710d29e 100644 --- a/src/app/widgets.rs +++ b/src/widgets.rs @@ -1,5 +1,3 @@ -// FIXME: Move this outside of app, along with components? - pub mod process_table; pub use process_table::*; diff --git a/src/app/widgets/battery_widget.rs b/src/widgets/battery_widget.rs index 68bbca79..68bbca79 100644 --- a/src/app/widgets/battery_widget.rs +++ b/src/widgets/battery_widget.rs diff --git a/src/app/widgets/cpu_graph.rs b/src/widgets/cpu_graph.rs index 7f0c1495..7f0c1495 100644 --- a/src/app/widgets/cpu_graph.rs +++ b/src/widgets/cpu_graph.rs diff --git a/src/app/widgets/disk_table.rs b/src/widgets/disk_table.rs index 1d4cc604..1d4cc604 100644 --- a/src/app/widgets/disk_table.rs +++ b/src/widgets/disk_table.rs diff --git a/src/app/widgets/mem_graph.rs b/src/widgets/mem_graph.rs index a86bd02a..a86bd02a 100644 --- a/src/app/widgets/mem_graph.rs +++ b/src/widgets/mem_graph.rs diff --git a/src/app/widgets/net_graph.rs b/src/widgets/net_graph.rs index e3526210..e3526210 100644 --- a/src/app/widgets/net_graph.rs +++ b/src/widgets/net_graph.rs diff --git a/src/app/widgets/process_table.rs b/src/widgets/process_table.rs index 6cd1bda9..390158ec 100644 --- a/src/app/widgets/process_table.rs +++ b/src/widgets/process_table.rs @@ -862,7 +862,7 @@ fn sort_skip_pid_asc(column: &ProcColumn, data: &mut [ProcWidgetData], order: So #[cfg(test)] mod test { use super::*; - use crate::app::widgets::MemUsage; + use crate::widgets::MemUsage; #[test] fn test_proc_sort() { diff --git a/src/app/widgets/process_table/proc_widget_column.rs b/src/widgets/process_table/proc_widget_column.rs index 691aec02..691aec02 100644 --- a/src/app/widgets/process_table/proc_widget_column.rs +++ b/src/widgets/process_table/proc_widget_column.rs diff --git a/src/app/widgets/process_table/proc_widget_data.rs b/src/widgets/process_table/proc_widget_data.rs index 94736336..94736336 100644 --- a/src/app/widgets/process_table/proc_widget_data.rs +++ b/src/widgets/process_table/proc_widget_data.rs diff --git a/src/app/widgets/process_table/sort_table.rs b/src/widgets/process_table/sort_table.rs index 5ace0ecb..5ace0ecb 100644 --- a/src/app/widgets/process_table/sort_table.rs +++ b/src/widgets/process_table/sort_table.rs diff --git a/src/app/widgets/temperature_table.rs b/src/widgets/temperature_table.rs index b7ee16a2..b7ee16a2 100644 --- a/src/app/widgets/temperature_table.rs +++ b/src/widgets/temperature_table.rs |