From 0659e788167ae7f70fe08f8cce9cf32877b9fc6a Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 9 Oct 2018 10:07:58 +0200 Subject: [PATCH] Refresh the LEDs when palette or theme changes via Focus When a Focus command changes either the palette, or the theme, call `LEDControl.refreshAll()` to repaint the LEDs. This way we don't have to force a repaint some other way, and changes take effect immediately, as they should. Fixes #8. Signed-off-by: Gergely Nagy --- src/Kaleidoscope/LED-Palette-Theme.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Kaleidoscope/LED-Palette-Theme.cpp b/src/Kaleidoscope/LED-Palette-Theme.cpp index b88e5fe0..c8b8d680 100644 --- a/src/Kaleidoscope/LED-Palette-Theme.cpp +++ b/src/Kaleidoscope/LED-Palette-Theme.cpp @@ -125,6 +125,8 @@ EventHandlerResult LEDPaletteTheme::onFocusEvent(const char *command) { i++; } + ::LEDControl.refreshAll(); + return EventHandlerResult::EVENT_CONSUMED; } @@ -164,6 +166,8 @@ EventHandlerResult LEDPaletteTheme::themeFocusEvent(const char *command, pos++; } + ::LEDControl.refreshAll(); + return EventHandlerResult::EVENT_CONSUMED; }