aboutsummaryrefslogtreecommitdiffstats
path: root/ColorsPanel.c
diff options
context:
space:
mode:
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r--ColorsPanel.c48
1 files changed, 25 insertions, 23 deletions
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 <assert.h>
@@ -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;

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