diff options
author | Daniel Lange <DLange@git.local> | 2021-01-11 20:43:28 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-01-11 20:43:28 +0100 |
commit | 94123a215ba971baf4ad7e12cc479258ddb8600e (patch) | |
tree | 6f053d8e1ce754ab7104b7364be9754231ab84de /ColorsPanel.c | |
parent | 50cb99f0acecb15992f3d5610c02676a6c94f2a4 (diff) | |
parent | c55320e9e2a8916e911bcd39ab37b79e3a7d03b2 (diff) | |
download | debian_htop-94123a215ba971baf4ad7e12cc479258ddb8600e.tar.gz debian_htop-94123a215ba971baf4ad7e12cc479258ddb8600e.tar.bz2 debian_htop-94123a215ba971baf4ad7e12cc479258ddb8600e.zip |
Update upstream source from tag 'upstream/3.0.5'
Update to upstream version '3.0.5'
with Debian dir 10922042e094a59dc72f9c39ddd4bfd59c7a302c
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r-- | ColorsPanel.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/ColorsPanel.c b/ColorsPanel.c index 2fb1c92..c076adc 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -60,26 +60,21 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { case KEY_MOUSE: case KEY_RECLICK: case ' ': + assert(mark >= 0); + assert(mark < LAST_COLORSCHEME); for (int i = 0; ColorSchemeNames[i] != NULL; i++) CheckItem_set((CheckItem*)Panel_get(super, i), false); CheckItem_set((CheckItem*)Panel_get(super, mark), true); this->settings->colorScheme = mark; - result = HANDLED; - } - - if (result == HANDLED) { this->settings->changed = true; - const Header* header = this->scr->header; + CRT_setColors(mark); clear(); - Panel* menu = (Panel*) Vector_get(this->scr->panels, 0); - Header_draw(header); - FunctionBar_draw(super->currentBar); - RichString_setAttr(&(super->header), CRT_colors[PANEL_HEADER_FOCUS]); - RichString_setAttr(&(menu->header), CRT_colors[PANEL_HEADER_UNFOCUS]); - ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2); + + result = HANDLED | REDRAW; } + return result; } @@ -100,6 +95,8 @@ ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { this->settings = settings; this->scr = scr; + assert(ARRAYSIZE(ColorSchemeNames) == LAST_COLORSCHEME + 1); + Panel_setHeader(super, "Colors"); for (int i = 0; ColorSchemeNames[i] != NULL; i++) { Panel_add(super, (Object*) CheckItem_newByVal(ColorSchemeNames[i], false)); |