forked from kofal.net/zmk
fix: Properly calculate highest active layer for display.
This commit is contained in:
committed by
Pete Johanson
parent
de38676afd
commit
cca637d66e
@@ -18,7 +18,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets);
|
||||
|
||||
struct layer_status_state {
|
||||
uint8_t index;
|
||||
zmk_keymap_layer_index_t index;
|
||||
const char *label;
|
||||
};
|
||||
|
||||
@@ -44,8 +44,9 @@ static void layer_status_update_cb(struct layer_status_state state) {
|
||||
}
|
||||
|
||||
static struct layer_status_state layer_status_get_state(const zmk_event_t *eh) {
|
||||
uint8_t index = zmk_keymap_highest_layer_active();
|
||||
return (struct layer_status_state){.index = index, .label = zmk_keymap_layer_name(index)};
|
||||
zmk_keymap_layer_index_t index = zmk_keymap_highest_layer_active();
|
||||
return (struct layer_status_state){
|
||||
.index = index, .label = zmk_keymap_layer_name(zmk_keymap_layer_index_to_id(index))};
|
||||
}
|
||||
|
||||
ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, layer_status_update_cb,
|
||||
|
||||
Reference in New Issue
Block a user