mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
LED Meter: display wide characters and restore non-wide ncurses support
Print wide characters, like degree sign, properly via mvadd_wch(). Ignore attributes when returning value from RichString_getCharVal() in non-wide ncurses mode to test against raw characters.
This commit is contained in:

committed by
cgzones

parent
b9adc30b86
commit
b5a5e83470
7
Meter.c
7
Meter.c
@ -414,10 +414,15 @@ static void LEDMeterMode_draw(Meter* this, int x, int y, int w) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
int c = RichString_getCharVal(out, i);
|
||||
if (c >= '0' && c <= '9') {
|
||||
LEDMeterMode_drawDigit(xx, y, c - 48);
|
||||
LEDMeterMode_drawDigit(xx, y, c - '0');
|
||||
xx += 4;
|
||||
} else {
|
||||
#ifdef HAVE_LIBNCURSESW
|
||||
out.chptr[i].attr = 0; /* use LED_COLOR from attrset() */
|
||||
mvadd_wch(yText, xx, &out.chptr[i]);
|
||||
#else
|
||||
mvaddch(yText, xx, c);
|
||||
#endif
|
||||
xx += 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user