diff options
author | Daniel Lange <DLange@git.local> | 2020-12-07 10:26:02 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2020-12-07 10:26:02 +0100 |
commit | d67ee86091f9e07f8d85c1fb77c7c58989e676bb (patch) | |
tree | 900f5e62bfd8e8c082be75a94f5348dea819beba /ColorsPanel.c | |
parent | 3cbc50cde37fee19ce98ee8260b0a6095b829c4c (diff) | |
parent | 65357c8c46154de4e4eca14075bfe5523bb5fc14 (diff) | |
download | debian_htop-d67ee86091f9e07f8d85c1fb77c7c58989e676bb.tar.gz debian_htop-d67ee86091f9e07f8d85c1fb77c7c58989e676bb.tar.bz2 debian_htop-d67ee86091f9e07f8d85c1fb77c7c58989e676bb.zip |
Update upstream source from tag 'upstream/3.0.3'
Update to upstream version '3.0.3'
with Debian dir 8a3a733dc80e45b1cde220f88fcfd815869742f0
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r-- | ColorsPanel.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/ColorsPanel.c b/ColorsPanel.c index cfd975d..2fb1c92 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -1,18 +1,24 @@ /* htop - ColorsPanel.c (C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPL, see the COPYING file +Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ #include "ColorsPanel.h" +#include <stdbool.h> +#include <stdlib.h> + #include "CRT.h" -#include "CheckItem.h" +#include "FunctionBar.h" +#include "Header.h" +#include "Object.h" +#include "OptionItem.h" +#include "ProvideCurses.h" +#include "RichString.h" +#include "Vector.h" -#include <assert.h> -#include <stdlib.h> -#include <string.h> // TO ADD A NEW SCHEME: // * Increment the size of bool check in ColorsPanel.h @@ -57,6 +63,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { 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; } @@ -68,6 +75,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { 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); @@ -75,7 +83,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { return result; } -PanelClass ColorsPanel_class = { +const PanelClass ColorsPanel_class = { .super = { .extends = Class(Panel), .delete = ColorsPanel_delete @@ -94,7 +102,7 @@ ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { Panel_setHeader(super, "Colors"); for (int i = 0; ColorSchemeNames[i] != NULL; i++) { - Panel_add(super, (Object*) CheckItem_newByVal(xStrdup(ColorSchemeNames[i]), false)); + Panel_add(super, (Object*) CheckItem_newByVal(ColorSchemeNames[i], false)); } CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true); return this; |