aboutsummaryrefslogtreecommitdiffstats
path: root/Meter.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:18 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:18 +0200
commit2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2 (patch)
treeafaa05858260763c1d25fa092f3905cf51ffd7b2 /Meter.c
parent031c3bb95f3d0a74d985286068baa6dd4d29d83f (diff)
downloaddebian_htop-2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2.tar.gz
debian_htop-2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2.tar.bz2
debian_htop-2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2.zip
Imported Upstream version 0.5.4upstream/0.5.4
Diffstat (limited to 'Meter.c')
-rw-r--r--Meter.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Meter.c b/Meter.c
index 45cf7e2..2e436e5 100644
--- a/Meter.c
+++ b/Meter.c
@@ -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);

© 2014-2024 Faster IT GmbH | imprint | privacy policy