diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-01-27 23:28:37 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-01-30 12:51:27 -0200 |
commit | 673f098734a03a5643465563b5df3e7a69ed9d7a (patch) | |
tree | e4b5a09eff3f9996c130e563f6f393d9632b2706 /FunctionBar.c | |
parent | ad99187680585bf66f9de4f617e897dada8767f7 (diff) |
Move responsibility for cursor placement to Panels
Diffstat (limited to 'FunctionBar.c')
-rw-r--r-- | FunctionBar.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index 4e4baaf3..630b1c83 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -96,11 +96,12 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) { } } -void FunctionBar_draw(const FunctionBar* this, char* buffer) { - FunctionBar_drawAttr(this, buffer, CRT_colors[FUNCTION_BAR]); +int FunctionBar_draw(const FunctionBar* this, char* buffer) { + return FunctionBar_drawAttr(this, buffer, CRT_colors[FUNCTION_BAR]); } -void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) { +int FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) { + int cursorX = 0; attrset(CRT_colors[FUNCTION_BAR]); mvhline(LINES-1, 0, ' ', COLS); int x = 0; @@ -115,12 +116,10 @@ void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) { if (buffer) { attrset(attr); mvaddstr(LINES-1, x, buffer); - CRT_cursorX = x + strlen(buffer); - curs_set(1); - } else { - curs_set(0); + cursorX = x + strlen(buffer); } attrset(CRT_colors[RESET_COLOR]); + return cursorX; } int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) { |