From e6181d4aa41daffbbfb3fb3a087a3bf635e3ed6a Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Sat, 9 May 2020 14:54:23 -0400 Subject: [PATCH 1/2] change: hide time legend if window gets too small --- CHANGELOG.md | 22 +++++++++++++++++++++- src/canvas/widgets/cpu_graph.rs | 2 ++ src/canvas/widgets/mem_graph.rs | 2 ++ src/canvas/widgets/network_graph.rs | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9508f9b..bfe65ef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Features -- [#114](https://github.com/ClementTsang/bottom/pull/114): Process state per process (originally in 0.4.0, moved to later). +- ~~[#114](https://github.com/ClementTsang/bottom/pull/114): Process state per process (originally in 0.4.0, moved to later).~~ + +- Moving down the CPU list will show only the corresponding graph. + +### Changes + +- Automatically hide time axis labels if the window gets too small. + +### Bug Fixes + +- The `` character can be used as an "AND" again (properly) in queries. For example: + +```bash +(btm cpu > 0) (discord mem > 0) +``` + +is equivalent to: + +```bash +(btm AND cpu > 0) AND (discord AND mem > 0) +``` ## [0.4.1] - 2020-05-05 diff --git a/src/canvas/widgets/cpu_graph.rs b/src/canvas/widgets/cpu_graph.rs index 73b8a9c0..e03e7d19 100644 --- a/src/canvas/widgets/cpu_graph.rs +++ b/src/canvas/widgets/cpu_graph.rs @@ -123,6 +123,8 @@ impl CpuGraphWidget for Painter { cpu_widget_state.autohide_timer = None; Axis::default().bounds([-(cpu_widget_state.current_display_time as f64), 0.0]) } + } else if draw_loc.height < 7 { + Axis::default().bounds([-(cpu_widget_state.current_display_time as f64), 0.0]) } else { Axis::default() .bounds([-(cpu_widget_state.current_display_time as f64), 0.0]) diff --git a/src/canvas/widgets/mem_graph.rs b/src/canvas/widgets/mem_graph.rs index 7224484f..96cd3030 100644 --- a/src/canvas/widgets/mem_graph.rs +++ b/src/canvas/widgets/mem_graph.rs @@ -44,6 +44,8 @@ impl MemGraphWidget for Painter { mem_widget_state.autohide_timer = None; Axis::default().bounds([-(mem_widget_state.current_display_time as f64), 0.0]) } + } else if draw_loc.height < 7 { + Axis::default().bounds([-(mem_widget_state.current_display_time as f64), 0.0]) } else { Axis::default() .bounds([-(mem_widget_state.current_display_time as f64), 0.0]) diff --git a/src/canvas/widgets/network_graph.rs b/src/canvas/widgets/network_graph.rs index 2cc0307f..583451d9 100644 --- a/src/canvas/widgets/network_graph.rs +++ b/src/canvas/widgets/network_graph.rs @@ -94,6 +94,8 @@ impl NetworkGraphWidget for Painter { Axis::default() .bounds([-(network_widget_state.current_display_time as f64), 0.0]) } + } else if draw_loc.height < 7 { + Axis::default().bounds([-(network_widget_state.current_display_time as f64), 0.0]) } else { Axis::default() .bounds([-(network_widget_state.current_display_time as f64), 0.0]) From 2124a6e0495374bcb586835fb6ca4f62574384c0 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Sat, 9 May 2020 14:55:01 -0400 Subject: [PATCH 2/2] docs: update readme a bit to thank more people :) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fa5dc567..8d318a69 100644 --- a/README.md +++ b/README.md @@ -555,3 +555,5 @@ Thanks to all contributors ([emoji key](https://allcontributors.org/docs/en/emoj - This application was written with many, _many_ libraries, and built on the work of many talented people. This application would be impossible without their work. + +- And of course, thanks to all contributors!