Rework drawing of FunctionBar

Draw the FunctionBar within Panel_draw instead of manually throughout
the code.
Add an optional PanelClass function drawFunctionBar, to allow specific
panels to override the default FunctionBar_draw call.
Rework the code on color change, to really change all colors (selection
markers and panel headers).

Closes: #402
This commit is contained in:
Christian Göttsche
2020-12-16 21:46:11 +01:00
parent 7e7a53c415
commit e3862aa67e
14 changed files with 93 additions and 89 deletions

View File

@ -112,10 +112,11 @@ void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr
attrset(attr);
}
mvaddstr(LINES - 1, x, buffer);
attrset(CRT_colors[RESET_COLOR]);
x += strlen(buffer);
}
attrset(CRT_colors[RESET_COLOR]);
if (setCursor) {
CRT_cursorX = x;
curs_set(1);
@ -132,10 +133,10 @@ void FunctionBar_append(const char* buffer, int attr) {
} else {
attrset(attr);
}
mvaddstr(LINES - 1, currentLen, buffer);
mvaddstr(LINES - 1, currentLen + 1, buffer);
attrset(CRT_colors[RESET_COLOR]);
currentLen += strlen(buffer);
currentLen += strlen(buffer) + 1;
}
int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) {