diff options
author | Eugene V. Lyubimkin <jackyf@debian.org> | 2011-11-26 15:58:33 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:30 +0200 |
commit | c65eb8be811f59b55d64d9e7654c33708de79ad9 (patch) | |
tree | ee6e542b988263c49f0e1200d6aa5aa635667fe8 /FunctionBar.c | |
parent | 38174fffd79f54a8be7642bf170a2320b29e8063 (diff) | |
parent | eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (diff) | |
download | debian_htop-c65eb8be811f59b55d64d9e7654c33708de79ad9.tar.gz debian_htop-c65eb8be811f59b55d64d9e7654c33708de79ad9.tar.bz2 debian_htop-c65eb8be811f59b55d64d9e7654c33708de79ad9.zip |
Imported Debian patch 1.0-1debian/1.0-1
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]); |