diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2020-12-17 19:08:56 -0300 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-12-19 16:02:34 +0100 |
commit | e8c6994f40c9c69089e9f80abb2f895d2e077c7e (patch) | |
tree | 7e5078da157f8efba1b3d3b82c95fed6c3276f9c /MainPanel.c | |
parent | 3d1703f16faf5bd3c73976909e1b6e03061a7f72 (diff) |
Add "Tree view is always sorted by PID" option to mimic htop 2 behavior
Diffstat (limited to 'MainPanel.c')
-rw-r--r-- | MainPanel.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/MainPanel.c b/MainPanel.c index 6c0c9fd1..f2b71e68 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -25,7 +25,7 @@ static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filt void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) { FunctionBar* bar = MainPanel_getFunctionBar(this); - FunctionBar_setLabel(bar, KEY_F(5), mode ? "Sorted" : "Tree "); + FunctionBar_setLabel(bar, KEY_F(5), mode ? "List " : "Tree "); } void MainPanel_pidSearch(MainPanel* this, int ch) { @@ -65,6 +65,9 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { } else { reaction |= Action_setSortKey(settings, field); } + if (settings->treeViewAlwaysByPID) { + settings->treeView = false; + } reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_SAVE_SETTINGS; result = HANDLED; } else if (ch != ERR && this->inc->active) { |