Add focus hook to accept theme updates for single layers

Requires https://github.com/keyboardio/Kaleidoscope-LED-Palette-Theme/pull/4
pull/389/head
James N. V. Cash 7 years ago
parent 6749727510
commit e76fc6cfa4

@ -65,6 +65,13 @@ bool ColormapEffect::focusHook(const char *command) {
map_base_, max_layers_);
}
bool ColormapEffect::focusHookLayerwise(const char *command) {
return ::LEDPaletteTheme.themeFocusHandlerLayerwise(command,
PSTR("colormap.layer"),
map_base_,
max_layers_);
}
}
kaleidoscope::ColormapEffect ColormapEffect;

@ -29,6 +29,7 @@ class ColormapEffect : public LEDMode {
void max_layers(uint8_t max_);
static bool focusHook(const char *command);
static bool focusHookLayerwise(const char *command);
protected:
void setup(void) final;
@ -47,3 +48,6 @@ extern kaleidoscope::ColormapEffect ColormapEffect;
#define FOCUS_HOOK_COLORMAP FOCUS_HOOK(ColormapEffect.focusHook, \
"colormap.map")
#define FOCUS_HOOK_COLORMAP_LAYER FOCUS_HOOK(ColormapEffect.focusHookLayerwise, \
"colormap.layer")

Loading…
Cancel
Save