Skip to content

Commit

Permalink
Added arrow key control for processes and the like, and fixed off by …
Browse files Browse the repository at this point in the history
…one error.
  • Loading branch information
ClementTsang committed Sep 25, 2019
1 parent a592472 commit b5cacb3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bottom"
version = "0.1.0-alpha.3"
version = "0.1.0-alpha.4"
authors = ["Clement Tsang <[email protected]>"]
edition = "2018"
repository = "https://github.com/ClementTsang/bottom"
Expand Down
2 changes: 1 addition & 1 deletion src/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ pub fn draw_data<B : backend::Backend>(terminal : &mut Terminal<B>, app_state :
if app_state.currently_selected_process_position < num_rows {
0
}
else if app_state.currently_selected_process_position - num_rows <= app_state.previous_process_position {
else if app_state.currently_selected_process_position - num_rows < app_state.previous_process_position {
app_state.previous_process_position
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/convert_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub fn update_temp_row(app_data : &data_collection::Data, temp_type : &data_coll
let mut sensor_vector : Vec<Vec<String>> = Vec::new();

if (&app_data.list_of_temperature_sensor).is_empty() {
sensor_vector.push(vec!["None Found".to_string(), "".to_string()])
sensor_vector.push(vec!["No Sensors Found".to_string(), "".to_string()])
}
else {
for sensor in &app_data.list_of_temperature_sensor {
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ fn main() -> error::Result<()> {
KeyEvent::Char('l') | KeyEvent::Right => app.on_right(),
KeyEvent::Char('k') | KeyEvent::Up => app.on_up(),
KeyEvent::Char('j') | KeyEvent::Down => app.on_down(),
KeyEvent::ShiftUp => app.decrement_position_count(),
KeyEvent::ShiftDown => app.increment_position_count(),
KeyEvent::Char(c) => app.on_key(c), // TODO: We can remove the 'q' event and just move it to the quit?
_ => {}
}
Expand Down

0 comments on commit b5cacb3

Please sign in to comment.