mirror of https://github.com/zmkfirmware/zmk.git
fix(display): Check layer name length too.
This commit is contained in:
parent
cca637d66e
commit
11f600d9e5
|
|
@ -27,7 +27,7 @@ static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
|
||||||
const char *layer_label = state.label;
|
const char *layer_label = state.label;
|
||||||
zmk_keymap_layer_index_t active_layer_index = state.index;
|
zmk_keymap_layer_index_t active_layer_index = state.index;
|
||||||
|
|
||||||
if (layer_label == NULL) {
|
if (layer_label == NULL || strlen(layer_label) == 0) {
|
||||||
char text[6] = {};
|
char text[6] = {};
|
||||||
|
|
||||||
sprintf(text, " %i", active_layer_index);
|
sprintf(text, " %i", active_layer_index);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ struct layer_status_state {
|
||||||
};
|
};
|
||||||
|
|
||||||
static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
|
static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
|
||||||
if (state.label == NULL) {
|
if (state.label == NULL || strlen(state.label) == 0) {
|
||||||
char text[8] = {};
|
char text[8] = {};
|
||||||
|
|
||||||
snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %i", state.index);
|
snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %i", state.index);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue