From fd4e6b432bcc0d6bac1a15a2ea492b4a540b75a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 5 Feb 2021 14:12:49 +0100 Subject: Use MainPanel type in State struct The State struct holds a pointer to the main process panel. Use the distinct MainPanel type, to improve maintainability regrading its usage. This avoids usages of down-casts from Panel to MainPanel, only up-casts from MainPanel to Panel are now required. --- ScreenManager.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ScreenManager.c') diff --git a/ScreenManager.c b/ScreenManager.c index df5fed4f..af9592c2 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -123,7 +123,11 @@ static void ScreenManager_drawPanels(ScreenManager* this, int focus, bool force_ const int nPanels = this->panelCount; for (int i = 0; i < nPanels; i++) { Panel* panel = (Panel*) Vector_get(this->panels, i); - Panel_draw(panel, force_redraw, i == focus, !((panel == this->state->panel) && this->state->hideProcessSelection), State_hideFunctionBar(this->state)); + Panel_draw(panel, + force_redraw, + i == focus, + panel != (Panel*)this->state->mainPanel || !this->state->hideProcessSelection, + State_hideFunctionBar(this->state)); mvvline(panel->y, panel->x + panel->w, ' ', panel->h + (State_hideFunctionBar(this->state) ? 1 : 0)); } } -- cgit v1.2.3