summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClementTsang <clementjhtsang@gmail.com>2019-09-25 12:35:32 -0400
committerClementTsang <clementjhtsang@gmail.com>2019-09-25 12:35:32 -0400
commitb5cacb3e2ed993310d9ebd178041e89f5d4fd754 (patch)
treeb726a8a0bbab48de889a87bcef7504adccf8e4b7
parenta5924725621e7b01c5d5b18dfe5e99d8fe4c0044 (diff)
Added arrow key control for processes and the like, and fixed off by one error.
-rw-r--r--Cargo.toml2
-rw-r--r--src/canvas.rs2
-rw-r--r--src/convert_data.rs2
-rw-r--r--src/main.rs2
4 files changed, 5 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index fb412211..6d3ac010 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bottom"
-version = "0.1.0-alpha.3"
+version = "0.1.0-alpha.4"
authors = ["Clement Tsang <clementjhtsang@gmail.com>"]
edition = "2018"
repository = "https://github.com/ClementTsang/bottom"
diff --git a/src/canvas.rs b/src/canvas.rs
index 7e13dd8f..cb35d723 100644
--- a/src/canvas.rs
+++ b/src/canvas.rs
@@ -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 {
diff --git a/src/convert_data.rs b/src/convert_data.rs
index d3bb3147..08a522e3 100644
--- a/src/convert_data.rs
+++ b/src/convert_data.rs
@@ -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 {
diff --git a/src/main.rs b/src/main.rs
index bb1562c0..6872498f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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?
_ => {}
}