diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:29 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:29 +0200 |
commit | eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (patch) | |
tree | 833f3fae6e3604a439f909c245a6e35f574997d7 /FunctionBar.c | |
parent | 283707c5e5bc436b78ea23bf5500cb6b16a01148 (diff) | |
download | debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.tar.gz debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.tar.bz2 debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.zip |
Imported Upstream version 1.0upstream/1.0
Diffstat (limited to 'FunctionBar.c')
-rw-r--r-- | FunctionBar.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index ee65333..ef0fcba 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -1,6 +1,6 @@ /* htop - FunctionBar.c -(C) 2004-2010 Hisham H. Muhammad +(C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ @@ -95,11 +95,11 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) { } } -void FunctionBar_draw(FunctionBar* this, char* buffer) { +void FunctionBar_draw(const FunctionBar* this, char* buffer) { FunctionBar_drawAttr(this, buffer, CRT_colors[FUNCTION_BAR]); } -void FunctionBar_drawAttr(FunctionBar* this, char* buffer, int attr) { +void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) { attrset(CRT_colors[FUNCTION_BAR]); mvhline(LINES-1, 0, ' ', COLS); int x = 0; @@ -111,14 +111,18 @@ void FunctionBar_drawAttr(FunctionBar* this, char* buffer, int attr) { mvaddstr(LINES-1, x, this->functions[i]); x += strlen(this->functions[i]); } - if (buffer != NULL) { + if (buffer) { attrset(attr); mvaddstr(LINES-1, x, buffer); + CRT_cursorX = x + strlen(buffer); + curs_set(1); + } else { + curs_set(0); } attrset(CRT_colors[RESET_COLOR]); } -int FunctionBar_synthesizeEvent(FunctionBar* this, int pos) { +int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) { int x = 0; for (int i = 0; i < this->size; i++) { x += strlen(this->keys[i]); |