diff options
author | Daniel Lange <DLange@git.local> | 2020-11-16 12:13:47 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2020-11-16 12:55:07 +0100 |
commit | 0951090fa45255cd0ae0df907240868c31689014 (patch) | |
tree | 8d923fa842a2a0be65ff2d786bcd6a01cfbcf66a /Panel.c | |
parent | 0411fdbcef51c1b2a39d9eeaa140a5b7c00bd3d2 (diff) | |
parent | a83f515f0fb75a079601be0d2e0e24b9402c9e15 (diff) |
Merge branch 'hili-new-old' of adsr/htop into highlight-new-old-processes
Diffstat (limited to 'Panel.c')
-rw-r--r-- | Panel.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -273,16 +273,18 @@ void Panel_draw(Panel* this, bool focus) { Object_display(itemObj, &item); int itemLen = RichString_sizeVal(item); int amt = MINIMUM(itemLen - scrollH, this->w); - bool selected = (i == this->selected); - if (selected) { - attrset(selectionColor); - RichString_setAttr(&item, selectionColor); + if (i == this->selected) { + item.highlightAttr = selectionColor; + } + if (item.highlightAttr) { + attrset(item.highlightAttr); + RichString_setAttr(&item, item.highlightAttr); this->selectedLen = itemLen; } mvhline(y + line, x, ' ', this->w); if (amt > 0) RichString_printoffnVal(item, y + line, x, scrollH, amt); - if (selected) + if (item.highlightAttr) attrset(CRT_colors[RESET_COLOR]); RichString_end(item); line++; |