Skip to content

Commit

Permalink
Preparation for Mem widget
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa0001-me authored and TokieSan committed May 8, 2023
1 parent feffd6c commit 46dfd39
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 192 deletions.
8 changes: 0 additions & 8 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub struct App<'a, 'b> {
pub struct Widgets<'a, 'b> {
pub disk: Option<DiskWidget<'a>>,
pub temp: Option<TempWidget<'a>>,
pub mem: Option<MemWidget<'a>>,
/*Widget Added for Patch*/
/*add your patch element here*/
pub net: Option<NetWidget<'a, 'b>>,
Expand All @@ -38,12 +37,6 @@ pub fn setup_app<'a, 'b>(
None
};

let mem = if args.mem || args.everything {
Some(MemWidget::new(colorscheme, args.interval))
} else {
None
};

/*add function for patch here.*/
/*add your patch here.*/

Expand Down Expand Up @@ -82,7 +75,6 @@ pub fn setup_app<'a, 'b>(
widgets: Widgets {
temp,
disk,
mem,
/* add var for patch*/
/* add your patch here*/
cpu,
Expand Down
4 changes: 0 additions & 4 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ pub struct Args {
#[structopt(short = "D", long = "disk")]
pub disk: bool,

/// Show Memory widget.
#[structopt(short = "M", long = "mem")]
pub mem: bool,

/*add your widget shortcut here*/
/*add your patch here*/

Expand Down
8 changes: 0 additions & 8 deletions src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ pub fn num_active_widgets(widgets: &mut Widgets) -> usize {
if widgets.disk.is_some() {
count += 1;
}
if widgets.mem.is_some() {
count += 1;
}
/*add your widget to count here*/
/*add your patch here*/
if widgets.proc.is_some() {
Expand Down Expand Up @@ -75,11 +72,6 @@ pub fn draw_widgets<B: Backend>(
row_idx += 1;
}

if let Some(mem) = widgets.mem.as_ref() {
frame.render_widget(mem, chunks[row_idx]);
row_idx += 1;
}

/*add yout widget to be drawn here*/
/*add your patch here*/

Expand Down
7 changes: 0 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,12 @@ fn main() {
if let Some(cpu) = app.widgets.cpu.as_mut() {
cpu.scale_in();
}

if let Some(mem) = app.widgets.mem.as_mut() {
mem.scale_in();
}
graphs_modified = true;
},
KeyCode::Char('l') => {
if let Some(cpu) = app.widgets.cpu.as_mut() {
cpu.scale_out();
}
if let Some(mem) = app.widgets.mem.as_mut() {
mem.scale_out();
}
graphs_modified = true;
},
KeyCode::Esc => {
Expand Down
4 changes: 0 additions & 4 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ pub fn update_widgets(widgets: &mut Widgets, seconds: Ratio<u64>) {
widgets_to_update.push(disk);
}

if let Some(mem) = widgets.mem.as_mut() {
widgets_to_update.push(mem);
}

/*add yout update function here*/
/*add yout patch here*/

Expand Down
159 changes: 0 additions & 159 deletions src/widgets/mem.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/widgets/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod disk;
mod temp;
mod net;
mod mem;
/*Add your widget name here*/
/*Add your patch here*/
mod proc;
Expand All @@ -12,7 +11,6 @@ mod help_menu;

pub use self::disk::DiskWidget;
pub use self::temp::TempWidget;
pub use self::mem::MemWidget;
/*Add your widget function prototype here*/
/*Add your patch here*/
pub use self::help_menu::HelpMenu;
Expand Down

0 comments on commit 46dfd39

Please sign in to comment.