diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-02-05 14:12:49 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-02-05 14:12:49 +0100 |
commit | fd4e6b432bcc0d6bac1a15a2ea492b4a540b75a1 (patch) | |
tree | 559e4dde1887a4f75b10309e2eddbf6843497ef0 /ScreenManager.c | |
parent | fd1ad863dca36da7166d9767218f5382074de4d2 (diff) |
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.
Diffstat (limited to 'ScreenManager.c')
-rw-r--r-- | ScreenManager.c | 6 |
1 files changed, 5 insertions, 1 deletions
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)); } } |