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 <algernon@keyboard.io>
pull/389/head
Gergely Nagy 6 years ago
parent 971b6fa4e7
commit 0659e78816

@ -125,6 +125,8 @@ EventHandlerResult LEDPaletteTheme::onFocusEvent(const char *command) {
i++; i++;
} }
::LEDControl.refreshAll();
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }
@ -164,6 +166,8 @@ EventHandlerResult LEDPaletteTheme::themeFocusEvent(const char *command,
pos++; pos++;
} }
::LEDControl.refreshAll();
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }

Loading…
Cancel
Save