diff options
author | Bartosz Fenski <fenio@debian.org> | 2005-11-04 17:25:27 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:19 +0200 |
commit | 55a3aa9e6a59c1bf0248869d9f08e31ec4057c61 (patch) | |
tree | e45fc349e224501aa3c3dfedbbd6e8f04a8ab62e /Meter.c | |
parent | 435b6ae69f41d58f3eefdfcbd63e739387868057 (diff) | |
parent | 2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2 (diff) | |
download | debian_htop-55a3aa9e6a59c1bf0248869d9f08e31ec4057c61.tar.gz debian_htop-55a3aa9e6a59c1bf0248869d9f08e31ec4057c61.tar.bz2 debian_htop-55a3aa9e6a59c1bf0248869d9f08e31ec4057c61.zip |
Imported Debian patch 0.5.4-1debian/0.5.4-1
Diffstat (limited to 'Meter.c')
-rw-r--r-- | Meter.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,6 +1,6 @@ /* -htop -(C) 2004 Hisham H. Muhammad +htop - Meter.c +(C) 2004,2005 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ @@ -46,7 +46,7 @@ struct Meter_ { Method_Meter_draw draw; Method_Meter_setValues setValues; int items; - int* attributes; + int** attributes; double* values; double total; char* caption; @@ -92,7 +92,7 @@ void Meter_init(Meter* this, char* name, char* caption, int items) { this->items = items; this->name = name; this->caption = caption; - this->attributes = malloc(sizeof(int) * items); + this->attributes = malloc(sizeof(int*) * items); this->values = malloc(sizeof(double) * items); this->displayBuffer.c = NULL; this->mode = UNSET; @@ -179,10 +179,10 @@ void Meter_drawBar(Meter* this, int x, int y, int w) { nextOffset = MIN(nextOffset, w); for (int j = offset; j < nextOffset; j++) if (bar[j] == ' ') { - if (CRT_hasColors) { - bar[j] = '|'; - } else { + if (CRT_colorScheme == COLORSCHEME_MONOCHROME) { bar[j] = Meter_barCharacters[i]; + } else { + bar[j] = '|'; } } offset = nextOffset; @@ -192,7 +192,7 @@ void Meter_drawBar(Meter* this, int x, int y, int w) { // ...then print the buffer. offset = 0; for (int i = 0; i < this->items; i++) { - attrset(this->attributes[i]); + attrset(*(this->attributes[i])); mvaddnstr(y, x + offset, bar + offset, blockSizes[i]); offset += blockSizes[i]; offset = MAX(offset, 0); |