diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2020-09-06 02:16:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 02:16:50 -0400 |
commit | 0d8572c6923c687c19a7cdbcc7128ba703e4e06d (patch) | |
tree | 18476d8512ef4cc19882e4ac5a1979847ab61f90 /src/app.rs | |
parent | cc87fa8e4a2693a0015290c62cd0ccdecec0815a (diff) |
fix: Fixes count being sortable, but nothing occuring (#224)
Fixes sorting by count being available, but doing nothing. This fix makes it sortable.
Diffstat (limited to 'src/app.rs')
-rw-r--r-- | src/app.rs | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -268,6 +268,19 @@ impl App { // Toggles process widget grouping state proc_widget_state.is_grouped = !(proc_widget_state.is_grouped); + // Forcefully switch off column if we were on it... + if (proc_widget_state.is_grouped + && proc_widget_state.process_sorting_type + == data_harvester::processes::ProcessSorting::Pid) + || (!proc_widget_state.is_grouped + && proc_widget_state.process_sorting_type + == data_harvester::processes::ProcessSorting::Count) + { + proc_widget_state.process_sorting_type = + data_harvester::processes::ProcessSorting::CpuPercent; // Go back to default, negate PID for group + proc_widget_state.process_sorting_reverse = true; + } + proc_widget_state .columns .column_mapping |