From a3cced9fb615a1cfe0b334fc41dc785f1fb9aef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 28 Dec 2020 23:26:14 +0100 Subject: Add option to hide the Function Bar Support three settings: - Always show Function Bar - Always hide the Function Bar, except in Infoscreens (Env/Locks...) and when editing the search and filter mode - Hide the Function Bar on ESC until the next user input Closes: #439 --- MainPanel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'MainPanel.c') diff --git a/MainPanel.c b/MainPanel.c index c8a4c059..9fbd69d9 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -51,6 +51,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { Htop_Reaction reaction = HTOP_OK; + /* reset on every normal key */ if (ch != ERR && ch != KEY_RESIZE) this->state->hideProcessSelection = false; @@ -160,8 +161,13 @@ bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Ar return ok; } -static void MainPanel_drawFunctionBar(Panel* super) { +static void MainPanel_drawFunctionBar(Panel* super, bool hideFunctionBar) { MainPanel* this = (MainPanel*) super; + + // Do not hide active search and filter bar. + if (hideFunctionBar && !this->inc->active) + return; + IncSet_drawBar(this->inc); if (this->state->pauseProcessUpdate) { FunctionBar_append("PAUSED", CRT_colors[PAUSED]); -- cgit v1.2.3