mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user