mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-27 15:44:17 +02:00
refactor: add glue to prep for the transition
Write some glue code to transition from the old code to the new one.
This commit is contained in:
parent
64c6d0c898
commit
88ebcab8f2
@ -53,4 +53,8 @@ impl Component for BatteryTable {
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for BatteryTable {}
|
||||
impl Widget for BatteryTable {
|
||||
fn get_pretty_name(&self) -> &'static str {
|
||||
"Battery"
|
||||
}
|
||||
}
|
||||
|
@ -124,4 +124,8 @@ impl Component for CpuGraph {
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for CpuGraph {}
|
||||
impl Widget for CpuGraph {
|
||||
fn get_pretty_name(&self) -> &'static str {
|
||||
"CPU"
|
||||
}
|
||||
}
|
||||
|
@ -73,4 +73,8 @@ impl Component for DiskTable {
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for DiskTable {}
|
||||
impl Widget for DiskTable {
|
||||
fn get_pretty_name(&self) -> &'static str {
|
||||
"Disk"
|
||||
}
|
||||
}
|
||||
|
@ -74,4 +74,8 @@ impl Component for MemGraph {
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for MemGraph {}
|
||||
impl Widget for MemGraph {
|
||||
fn get_pretty_name(&self) -> &'static str {
|
||||
"Memory"
|
||||
}
|
||||
}
|
||||
|
@ -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!
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -811,4 +811,8 @@ impl Component for ProcessManager {
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for ProcessManager {}
|
||||
impl Widget for ProcessManager {
|
||||
fn get_pretty_name(&self) -> &'static str {
|
||||
"Processes"
|
||||
}
|
||||
}
|
||||
|
@ -73,4 +73,8 @@ impl Component for TempTable {
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for TempTable {}
|
||||
impl Widget for TempTable {
|
||||
fn get_pretty_name(&self) -> &'static str {
|
||||
"Temperature"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user