diff options
author | Daniel Lange <DLange@git.local> | 2021-09-21 08:35:19 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-09-21 08:35:19 +0200 |
commit | 69f439eff387a6ecb52734e400b297a3c85f2285 (patch) | |
tree | 2a988b7868b749654796183ba70b4272965da1bf /ColorsPanel.c | |
parent | c55320e9e2a8916e911bcd39ab37b79e3a7d03b2 (diff) | |
download | debian_htop-69f439eff387a6ecb52734e400b297a3c85f2285.tar.gz debian_htop-69f439eff387a6ecb52734e400b297a3c85f2285.tar.bz2 debian_htop-69f439eff387a6ecb52734e400b297a3c85f2285.zip |
New upstream version 3.1.0upstream/3.1.0
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r-- | ColorsPanel.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ColorsPanel.c b/ColorsPanel.c index c076adc..79f001c 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -7,17 +7,16 @@ in the source distribution for its full text. #include "ColorsPanel.h" +#include <assert.h> #include <stdbool.h> #include <stdlib.h> #include "CRT.h" #include "FunctionBar.h" -#include "Header.h" +#include "Macros.h" #include "Object.h" #include "OptionItem.h" #include "ProvideCurses.h" -#include "RichString.h" -#include "Vector.h" // TO ADD A NEW SCHEME: @@ -51,7 +50,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { ColorsPanel* this = (ColorsPanel*) super; HandlerResult result = IGNORED; - int mark = Panel_getSelectedIndex(super); + int mark; switch(ch) { case 0x0a: @@ -60,6 +59,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { case KEY_MOUSE: case KEY_RECLICK: case ' ': + mark = Panel_getSelectedIndex(super); assert(mark >= 0); assert(mark < LAST_COLORSCHEME); for (int i = 0; ColorSchemeNames[i] != NULL; i++) @@ -86,14 +86,13 @@ const PanelClass ColorsPanel_class = { .eventHandler = ColorsPanel_eventHandler }; -ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { +ColorsPanel* ColorsPanel_new(Settings* settings) { ColorsPanel* this = AllocThis(ColorsPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(ColorsFunctions, NULL, NULL); Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar); this->settings = settings; - this->scr = scr; assert(ARRAYSIZE(ColorSchemeNames) == LAST_COLORSCHEME + 1); |