mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
Introduce screen tabs
This is a forward port (by nathans) of Hisham's original code.
This commit is contained in:

committed by
Nathan Scott

parent
ff4f44b22a
commit
72ba20fa5f
@ -88,11 +88,12 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) {
|
||||
}
|
||||
}
|
||||
|
||||
void FunctionBar_draw(const FunctionBar* this) {
|
||||
FunctionBar_drawExtra(this, NULL, -1, false);
|
||||
int FunctionBar_draw(const FunctionBar* this) {
|
||||
return FunctionBar_drawExtra(this, NULL, -1, false);
|
||||
}
|
||||
|
||||
void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor) {
|
||||
int FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor) {
|
||||
int cursorX = 0;
|
||||
attrset(CRT_colors[FUNCTION_BAR]);
|
||||
mvhline(LINES - 1, 0, ' ', COLS);
|
||||
int x = 0;
|
||||
@ -113,18 +114,20 @@ void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr
|
||||
}
|
||||
mvaddstr(LINES - 1, x, buffer);
|
||||
x += strlen(buffer);
|
||||
cursorX = x;
|
||||
}
|
||||
|
||||
attrset(CRT_colors[RESET_COLOR]);
|
||||
|
||||
if (setCursor) {
|
||||
CRT_cursorX = x;
|
||||
curs_set(1);
|
||||
} else {
|
||||
curs_set(0);
|
||||
}
|
||||
|
||||
currentLen = x;
|
||||
|
||||
return cursorX;
|
||||
}
|
||||
|
||||
void FunctionBar_append(const char* buffer, int attr) {
|
||||
|
Reference in New Issue
Block a user