aboutsummaryrefslogtreecommitdiffstats
path: root/ColorsPanel.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-12-07 10:26:01 +0100
committerDaniel Lange <DLange@git.local>2020-12-07 10:26:01 +0100
commit65357c8c46154de4e4eca14075bfe5523bb5fc14 (patch)
tree8f430ee5a0d5de377c4e7c94e47842a27c70d7e8 /ColorsPanel.c
parentf80394a20254938142011855f2954b3f63fe5909 (diff)
downloaddebian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.tar.gz
debian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.tar.bz2
debian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.zip
New upstream version 3.0.3upstream/3.0.3
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r--ColorsPanel.c22
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy