Merge pull request #5 from jamesnvc/layerwise-focus-hooks

Add focus hook to accept theme updates for single layers
pull/389/head
Gergely Nagy 7 years ago committed by GitHub
commit fb524cc0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

Loading…
Cancel
Save