From e7372d18a1a661d8c3dba9f51e1f17b5f94171a7 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Wed, 10 Jan 2024 11:17:08 +0100 Subject: New upstream version 3.3.0 --- ColorsPanel.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'ColorsPanel.c') diff --git a/ColorsPanel.c b/ColorsPanel.c index 5900884..581c3a0 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "ColorsPanel.h" #include @@ -13,7 +15,6 @@ in the source distribution for its full text. #include "CRT.h" #include "FunctionBar.h" -#include "Macros.h" #include "Object.h" #include "OptionItem.h" #include "ProvideCurses.h" @@ -50,30 +51,31 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { ColorsPanel* this = (ColorsPanel*) super; HandlerResult result = IGNORED; - int mark; switch (ch) { - case 0x0a: - case 0x0d: - case KEY_ENTER: - 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++) - CheckItem_set((CheckItem*)Panel_get(super, i), false); - CheckItem_set((CheckItem*)Panel_get(super, mark), true); - - this->settings->colorScheme = mark; - this->settings->changed = true; - this->settings->lastUpdate++; - - CRT_setColors(mark); - clear(); - - result = HANDLED | REDRAW; + case 0x0a: + case 0x0d: + case KEY_ENTER: + case KEY_MOUSE: + case KEY_RECLICK: + case ' ': { + int mark = Panel_getSelectedIndex(super); + 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; + this->settings->changed = true; + this->settings->lastUpdate++; + + CRT_setColors(mark); + clear(); + + result = HANDLED | REDRAW; + } } return result; -- cgit v1.2.3