mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Add Unicode support, enabled with the --enable-unicode
flag, which requires libncursesw. Thanks to Sergej Pupykin!
This commit is contained in:
14
Panel.c
14
Panel.c
@ -265,8 +265,8 @@ void Panel_draw(Panel* this, bool focus) {
|
||||
attrset(attr);
|
||||
mvhline(y, x, ' ', this->w);
|
||||
if (scrollH < this->header.len) {
|
||||
mvaddchnstr(y, x, this->header.chstr + scrollH,
|
||||
MIN(this->header.len - scrollH, this->w));
|
||||
RichString_printoffnVal(this->header, y, x, scrollH,
|
||||
MIN(this->header.len - scrollH, this->w));
|
||||
}
|
||||
attrset(CRT_colors[RESET_COLOR]);
|
||||
y++;
|
||||
@ -289,12 +289,12 @@ void Panel_draw(Panel* this, bool focus) {
|
||||
RichString_setAttr(&itemRef, highlight);
|
||||
mvhline(y + j, x+0, ' ', this->w);
|
||||
if (amt > 0)
|
||||
mvaddchnstr(y+j, x+0, itemRef.chstr + scrollH, amt);
|
||||
RichString_printoffnVal(itemRef, y+j, x+0, scrollH, amt);
|
||||
attrset(CRT_colors[RESET_COLOR]);
|
||||
} else {
|
||||
mvhline(y+j, x+0, ' ', this->w);
|
||||
if (amt > 0)
|
||||
mvaddchnstr(y+j, x+0, itemRef.chstr + scrollH, amt);
|
||||
RichString_printoffnVal(itemRef, y+j, x+0, scrollH, amt);
|
||||
}
|
||||
}
|
||||
for (int i = y + (last - first); i < y + this->h; i++)
|
||||
@ -312,12 +312,14 @@ void Panel_draw(Panel* this, bool focus) {
|
||||
newObj->display(newObj, &newRef);
|
||||
mvhline(y+ this->oldSelected - this->scrollV, x+0, ' ', this->w);
|
||||
if (scrollH < oldRef.len)
|
||||
mvaddchnstr(y+ this->oldSelected - this->scrollV, x+0, oldRef.chstr + this->scrollH, MIN(oldRef.len - scrollH, this->w));
|
||||
RichString_printoffnVal(oldRef, y+this->oldSelected - this->scrollV, x,
|
||||
this->scrollH, MIN(oldRef.len - scrollH, this->w));
|
||||
attrset(highlight);
|
||||
mvhline(y+this->selected - this->scrollV, x+0, ' ', this->w);
|
||||
RichString_setAttr(&newRef, highlight);
|
||||
if (scrollH < newRef.len)
|
||||
mvaddchnstr(y+this->selected - this->scrollV, x+0, newRef.chstr + this->scrollH, MIN(newRef.len - scrollH, this->w));
|
||||
RichString_printoffnVal(newRef, y+this->selected - this->scrollV, x,
|
||||
this->scrollH, MIN(newRef.len - scrollH, this->w));
|
||||
attrset(CRT_colors[RESET_COLOR]);
|
||||
}
|
||||
this->oldSelected = this->selected;
|
||||
|
Reference in New Issue
Block a user