Add "Tree view is always sorted by PID" option to mimic htop 2 behavior

This commit is contained in:
Hisham Muhammad
2020-12-17 19:08:56 -03:00
committed by BenBE
parent 3d1703f16f
commit e8c6994f40
7 changed files with 30 additions and 6 deletions

View File

@ -160,6 +160,9 @@ static bool collapseIntoParent(Panel* panel) {
Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey) {
settings->sortKey = sortKey;
settings->direction = 1;
if (settings->treeViewAlwaysByPID) {
settings->treeView = false;
}
return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_UPDATE_PANELHDR | HTOP_KEEP_FOLLOWING;
}