mirror of
https://github.com/ClementTsang/bottom
synced 2025-02-16 13:18:28 +00:00
change: Allow e to also close expanded widgets
Allow `e` to toggle expansion, rather than only allowing it to open.
This commit is contained in:
parent
1a25fbb987
commit
3252796f17
4 changed files with 14 additions and 3 deletions
|
@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
backwards compatibility's sake, for macOS, this will still check `.config` if it exists first,
|
||||
but otherwise, it will default to the new location.
|
||||
|
||||
- Allow `e` to also escape expanded mode.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [#183](https://github.com/ClementTsang/bottom/pull/183): Fixed bug in basic mode where the battery widget was placed incorrectly.
|
||||
|
|
|
@ -199,7 +199,7 @@ Run using `btm`.
|
|||
| `?` | Open help menu |
|
||||
| `gg`, `Home` | Jump to the first entry |
|
||||
| `Shift-g`, `End` | Jump to the last entry |
|
||||
| `e` | Expand the currently selected widget |
|
||||
| `e` | Toggle expanding the currently selected widget |
|
||||
| `+` | Zoom in on chart (decrease time range) |
|
||||
| `-` | Zoom out on chart (increase time range) |
|
||||
| `=` | Reset zoom |
|
||||
|
|
11
src/app.rs
11
src/app.rs
|
@ -1151,7 +1151,7 @@ impl App {
|
|||
'+' => self.zoom_in(),
|
||||
'-' => self.zoom_out(),
|
||||
'=' => self.reset_zoom(),
|
||||
'e' => self.expand_widget(),
|
||||
'e' => self.toggle_expand_widget(),
|
||||
's' => self.toggle_sort(),
|
||||
'I' => self.invert_sort(),
|
||||
'%' => self.toggle_percentages(),
|
||||
|
@ -1186,6 +1186,15 @@ impl App {
|
|||
self.to_delete_process_list.clone()
|
||||
}
|
||||
|
||||
fn toggle_expand_widget(&mut self) {
|
||||
if self.is_expanded {
|
||||
self.is_expanded = false;
|
||||
self.is_force_redraw = true;
|
||||
} else {
|
||||
self.expand_widget();
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
|
|
|
@ -78,7 +78,7 @@ pub const GENERAL_HELP_TEXT: [&str; 29] = [
|
|||
"? Open help menu\n",
|
||||
"gg Jump to the first entry\n",
|
||||
"G Jump to the last entry\n",
|
||||
"e Expand the currently selected widget\n",
|
||||
"e Toggle expanding the currently selected widget\n",
|
||||
"+ Zoom in on chart (decrease time range)\n",
|
||||
"- Zoom out on chart (increase time range)\n",
|
||||
"= Reset zoom\n",
|
||||
|
|
Loading…
Add table
Reference in a new issue