change: Use e key instead to maximize; rename to expand

This commit is contained in:
ClementTsang 2020-04-29 23:52:25 -04:00
parent edd5cff12d
commit ecd5a003cf
4 changed files with 24 additions and 17 deletions

View File

@ -44,6 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#134](https://github.com/ClementTsang/bottom/pull/134): Added `hjkl` movement to delete dialog.
- [#59](https://github.com/ClementTsang/bottom/issues/59): Moved maximization key to `e`, renamed feature to _expanding_ the widget. Done to allow for the `<Enter>` key to be used later for a more intuitive usage.
- [#59](https://github.com/ClementTsang/bottom/issues/59): Redesigned search menu and query.
### Bug Fixes

View File

@ -9,7 +9,7 @@ A cross-platform graphical process/system monitor with a customizable interface
<!--TODO: Update recording for 0.4-->
![Quick demo recording showing off searching, maximizing, and process killing.](assets/summary_and_search.gif) _Theme based on [gruvbox](https://github.com/morhetz/gruvbox) (see [sample config](./sample_configs/demo_config.toml))._ Recorded on version 0.2.0.
![Quick demo recording showing off searching, expanding, and process killing.](assets/summary_and_search.gif) _Theme based on [gruvbox](https://github.com/morhetz/gruvbox) (see [sample config](./sample_configs/demo_config.toml))._ Recorded on version 0.2.0.
**Note**: This documentation is relevant to version 0.4.0 and may refer to in-development or unreleased features, especially if you are reading this on the master branch. Please refer to [release branch](https://github.com/ClementTsang/bottom/tree/release/README.md) or [crates.io](https://crates.io/crates/bottom) for the most up-to-date _release_ documentation.
@ -35,7 +35,7 @@ A cross-platform graphical process/system monitor with a customizable interface
- [Features](#features)
- [Process filtering](#process-filtering)
- [Zoom](#zoom)
- [Maximizing](#maximizing)
- [Expanding](#expanding)
- [Basic mode](#basic-mode)
- [Config files](#config-files)
- [Config flags](#config-flags)
@ -170,7 +170,7 @@ Run using `btm`.
| | |
| -------------------------------------------------- | ---------------------------------------------------------------------------- |
| `q`, `Ctrl-c` | Quit |
| `Esc` | Close dialog windows, search, widgets, or exit maximized mode |
| `Esc` | Close dialog windows, search, widgets, or exit expanded mode |
| `Ctrl-r` | Reset display and any collected data |
| `f` | Freeze/unfreeze updating with new data |
| `Ctrl`-arrow key<br>`Shift`-arrow key<br>`H/J/K/L` | Move to a different widget (on macOS some keybindings may conflict) |
@ -181,7 +181,7 @@ Run using `btm`.
| `?` | Open help menu |
| `gg`, `Home` | Jump to the first entry |
| `Shift-g`, `End` | Jump to the last entry |
| `Enter` | Maximize the currently selected widget |
| `e` | Expand the currently selected widget |
| `+` | Zoom in on chart (decrease time range) |
| `-` | Zoom out on chart (increase time range) |
| `=` | Reset zoom |
@ -266,9 +266,9 @@ Using the `+`/`-` keys or the scroll wheel will move the current time intervals
Widgets can hold different time intervals independently. These time intervals can be adjusted using the
`-t`/`--default_time_value` and `-d`/`--time_delta` options, or their corresponding config options.
### Maximizing
### Expand
Only care about one specific widget? You can go to that widget and hit `Enter` to make that widget take
Only care about one specific widget? You can go to that widget and hit `e` to make that widget expand and take
up the entire drawing area.
### Basic mode

View File

@ -533,16 +533,6 @@ impl App {
} else {
self.delete_dialog_state.is_showing_dd = false;
}
} else if !self.is_in_dialog() && !self.app_config_fields.use_basic_mode {
// Pop-out mode. We ignore if in process search.
match self.current_widget.widget_type {
BottomWidgetType::ProcSearch => {}
_ => {
self.is_expanded = true;
self.is_force_redraw = true;
}
}
}
}
@ -1178,6 +1168,7 @@ impl App {
'+' => self.zoom_in(),
'-' => self.zoom_out(),
'=' => self.reset_zoom(),
'e' => self.expand_widget(),
_ => {}
}
@ -1209,6 +1200,20 @@ impl App {
self.to_delete_process_list.clone()
}
fn expand_widget(&mut self) {
if !self.is_in_dialog() && !self.app_config_fields.use_basic_mode {
// Pop-out mode. We ignore if in process search.
match self.current_widget.widget_type {
BottomWidgetType::ProcSearch => {}
_ => {
self.is_expanded = true;
self.is_force_redraw = true;
}
}
}
}
pub fn move_widget_selection_left(&mut self) {
if !self.is_in_dialog() && !self.is_expanded {
if let Some(current_widget) = self.widget_map.get(&self.current_widget.widget_id) {

View File

@ -65,7 +65,7 @@ pub const GENERAL_HELP_TEXT: [&str; 20] = [
"? Open help menu\n",
"gg Jump to the first entry\n",
"G Jump to the last entry\n",
"Enter Maximize the currently selected widget\n",
"e Expand the currently selected widget\n",
"+ Zoom in on chart (decrease time range)\n",
"- Zoom out on chart (increase time range)\n",
"= Reset zoom\n",