diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2021-01-12 21:41:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 21:41:59 -0500 |
commit | e30518bf6213bb99d333f836ecaeb252f967d41e (patch) | |
tree | 0b68eeba80f477d239c3faea18550c94f46dadb2 /src/app.rs | |
parent | c57ce0b45a42dcdce819e317b69413f09ea1fcfa (diff) |
bug: Fix missing sorting arrow when for non-% mem (#389)
Fixes a bug where you could make the sorting arrow disappear in the mem column if you did:
1. Go to proc widget
2. Switch to memory values from %
3. Press `m`
Diffstat (limited to 'src/app.rs')
-rw-r--r-- | src/app.rs | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1423,13 +1423,21 @@ impl App { .get_mut_widget_state(self.current_widget.widget_id) { match proc_widget_state.process_sorting_type { - processes::ProcessSorting::MemPercent => { + processes::ProcessSorting::MemPercent + | processes::ProcessSorting::Mem => { proc_widget_state.is_process_sort_descending = !proc_widget_state.is_process_sort_descending } + _ => { - proc_widget_state.process_sorting_type = - processes::ProcessSorting::MemPercent; + proc_widget_state.process_sorting_type = if proc_widget_state + .columns + .is_enabled(&processes::ProcessSorting::MemPercent) + { + processes::ProcessSorting::MemPercent + } else { + processes::ProcessSorting::Mem + }; proc_widget_state.is_process_sort_descending = true; } } |