mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 21:14:35 +03:00
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.
This commit is contained in:
@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user