diff --git a/src/app/widgets/battery.rs b/src/app/widgets/battery.rs index 64236163..11459870 100644 --- a/src/app/widgets/battery.rs +++ b/src/app/widgets/battery.rs @@ -53,4 +53,8 @@ impl Component for BatteryTable { } } -impl Widget for BatteryTable {} +impl Widget for BatteryTable { + fn get_pretty_name(&self) -> &'static str { + "Battery" + } +} diff --git a/src/app/widgets/cpu.rs b/src/app/widgets/cpu.rs index ceb5e0d5..fabeed5c 100644 --- a/src/app/widgets/cpu.rs +++ b/src/app/widgets/cpu.rs @@ -124,4 +124,8 @@ impl Component for CpuGraph { } } -impl Widget for CpuGraph {} +impl Widget for CpuGraph { + fn get_pretty_name(&self) -> &'static str { + "CPU" + } +} diff --git a/src/app/widgets/disk.rs b/src/app/widgets/disk.rs index 7ae70229..18fd7704 100644 --- a/src/app/widgets/disk.rs +++ b/src/app/widgets/disk.rs @@ -73,4 +73,8 @@ impl Component for DiskTable { } } -impl Widget for DiskTable {} +impl Widget for DiskTable { + fn get_pretty_name(&self) -> &'static str { + "Disk" + } +} diff --git a/src/app/widgets/mem.rs b/src/app/widgets/mem.rs index a11d48a0..dc23f244 100644 --- a/src/app/widgets/mem.rs +++ b/src/app/widgets/mem.rs @@ -74,4 +74,8 @@ impl Component for MemGraph { } } -impl Widget for MemGraph {} +impl Widget for MemGraph { + fn get_pretty_name(&self) -> &'static str { + "Memory" + } +} diff --git a/src/app/widgets/mod.rs b/src/app/widgets/mod.rs index a80aa5dc..5920aabb 100644 --- a/src/app/widgets/mod.rs +++ b/src/app/widgets/mod.rs @@ -92,6 +92,8 @@ pub trait Widget { fn handle_widget_selection_down(&mut self) -> SelectionAction { SelectionAction::NotHandled } + + fn get_pretty_name(&self) -> &'static str; } /// The "main" widgets that are used by bottom to display information! diff --git a/src/app/widgets/net.rs b/src/app/widgets/net.rs index e2bd3db7..8be2f106 100644 --- a/src/app/widgets/net.rs +++ b/src/app/widgets/net.rs @@ -145,7 +145,11 @@ impl Component for NetGraph { } } -impl Widget for NetGraph {} +impl Widget for NetGraph { + fn get_pretty_name(&self) -> &'static str { + "Network" + } +} /// A widget denoting network usage via a graph and a separate, single row table. This is built on [`NetGraph`], /// and the main difference is that it also contains a bounding box for the graph + text. @@ -186,4 +190,8 @@ impl Component for OldNetGraph { } } -impl Widget for OldNetGraph {} +impl Widget for OldNetGraph { + fn get_pretty_name(&self) -> &'static str { + "Network" + } +} diff --git a/src/app/widgets/process.rs b/src/app/widgets/process.rs index 48070f11..b5357ddd 100644 --- a/src/app/widgets/process.rs +++ b/src/app/widgets/process.rs @@ -811,4 +811,8 @@ impl Component for ProcessManager { } } -impl Widget for ProcessManager {} +impl Widget for ProcessManager { + fn get_pretty_name(&self) -> &'static str { + "Processes" + } +} diff --git a/src/app/widgets/temp.rs b/src/app/widgets/temp.rs index 1234e149..ef54dab6 100644 --- a/src/app/widgets/temp.rs +++ b/src/app/widgets/temp.rs @@ -73,4 +73,8 @@ impl Component for TempTable { } } -impl Widget for TempTable {} +impl Widget for TempTable { + fn get_pretty_name(&self) -> &'static str { + "Temperature" + } +}