From 65357c8c46154de4e4eca14075bfe5523bb5fc14 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 7 Dec 2020 10:26:01 +0100 Subject: New upstream version 3.0.3 --- ColorsPanel.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'ColorsPanel.c') 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 +#include + #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 -#include -#include // 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; -- cgit v1.2.3