From e8c6994f40c9c69089e9f80abb2f895d2e077c7e Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 17 Dec 2020 19:08:56 -0300 Subject: Add "Tree view is always sorted by PID" option to mimic htop 2 behavior --- MainPanel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'MainPanel.c') 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) { -- cgit v1.2.3