diff --git a/app/boards/shields/corne/Kconfig.defconfig b/app/boards/shields/corne/Kconfig.defconfig index 35bc2991..c9a6989a 100644 --- a/app/boards/shields/corne/Kconfig.defconfig +++ b/app/boards/shields/corne/Kconfig.defconfig @@ -28,23 +28,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/elephant42/Kconfig.defconfig b/app/boards/shields/elephant42/Kconfig.defconfig index db2fa230..33b73a55 100644 --- a/app/boards/shields/elephant42/Kconfig.defconfig +++ b/app/boards/shields/elephant42/Kconfig.defconfig @@ -31,23 +31,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/jorne/Kconfig.defconfig b/app/boards/shields/jorne/Kconfig.defconfig index 5e5830db..ca670fcc 100644 --- a/app/boards/shields/jorne/Kconfig.defconfig +++ b/app/boards/shields/jorne/Kconfig.defconfig @@ -29,23 +29,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/knob_goblin/Kconfig.defconfig b/app/boards/shields/knob_goblin/Kconfig.defconfig index 07df5996..f0a29747 100644 --- a/app/boards/shields/knob_goblin/Kconfig.defconfig +++ b/app/boards/shields/knob_goblin/Kconfig.defconfig @@ -21,23 +21,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/kyria/Kconfig.defconfig b/app/boards/shields/kyria/Kconfig.defconfig index 74a22520..c52f5a82 100644 --- a/app/boards/shields/kyria/Kconfig.defconfig +++ b/app/boards/shields/kyria/Kconfig.defconfig @@ -29,23 +29,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 64 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/leeloo/Kconfig.defconfig b/app/boards/shields/leeloo/Kconfig.defconfig index 615f890b..227c8e09 100644 --- a/app/boards/shields/leeloo/Kconfig.defconfig +++ b/app/boards/shields/leeloo/Kconfig.defconfig @@ -31,23 +31,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/lily58/Kconfig.defconfig b/app/boards/shields/lily58/Kconfig.defconfig index c09fcd7d..d81c4f14 100644 --- a/app/boards/shields/lily58/Kconfig.defconfig +++ b/app/boards/shields/lily58/Kconfig.defconfig @@ -29,23 +29,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/lotus58/Kconfig.defconfig b/app/boards/shields/lotus58/Kconfig.defconfig index f0d35f4d..2fc4ef17 100644 --- a/app/boards/shields/lotus58/Kconfig.defconfig +++ b/app/boards/shields/lotus58/Kconfig.defconfig @@ -31,23 +31,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/microdox/Kconfig.defconfig b/app/boards/shields/microdox/Kconfig.defconfig index 4115577d..b9575940 100644 --- a/app/boards/shields/microdox/Kconfig.defconfig +++ b/app/boards/shields/microdox/Kconfig.defconfig @@ -31,23 +31,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/murphpad/Kconfig.defconfig b/app/boards/shields/murphpad/Kconfig.defconfig index 8e205a8e..42f0f01f 100644 --- a/app/boards/shields/murphpad/Kconfig.defconfig +++ b/app/boards/shields/murphpad/Kconfig.defconfig @@ -21,23 +21,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/nibble/Kconfig.defconfig b/app/boards/shields/nibble/Kconfig.defconfig index 2df1d812..f3957669 100644 --- a/app/boards/shields/nibble/Kconfig.defconfig +++ b/app/boards/shields/nibble/Kconfig.defconfig @@ -25,23 +25,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/sofle/Kconfig.defconfig b/app/boards/shields/sofle/Kconfig.defconfig index fcee7fbe..973baabc 100644 --- a/app/boards/shields/sofle/Kconfig.defconfig +++ b/app/boards/shields/sofle/Kconfig.defconfig @@ -31,23 +31,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/tidbit/Kconfig.defconfig b/app/boards/shields/tidbit/Kconfig.defconfig index 177e2675..775b89a4 100644 --- a/app/boards/shields/tidbit/Kconfig.defconfig +++ b/app/boards/shields/tidbit/Kconfig.defconfig @@ -22,23 +22,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 32 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/boards/shields/zodiark/Kconfig.defconfig b/app/boards/shields/zodiark/Kconfig.defconfig index cdad43f6..3becfa5c 100644 --- a/app/boards/shields/zodiark/Kconfig.defconfig +++ b/app/boards/shields/zodiark/Kconfig.defconfig @@ -31,23 +31,23 @@ endif # ZMK_DISPLAY if LVGL -config LVGL_HOR_RES_MAX +config LV_Z_HOR_RES_MAX default 128 -config LVGL_VER_RES_MAX +config LV_Z_VER_RES_MAX default 64 -config LVGL_VDB_SIZE +config LV_Z_VDB_SIZE default 64 -config LVGL_DPI +config LV_Z_DPI default 148 -config LVGL_BITS_PER_PIXEL +config LV_Z_BITS_PER_PIXEL default 1 -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 +choice LV_COLOR_DEPTH_BITS + default LV_COLOR_DEPTH_1 endchoice endif # LVGL diff --git a/app/src/display/Kconfig b/app/src/display/Kconfig index 8023025a..bf3677c2 100644 --- a/app/src/display/Kconfig +++ b/app/src/display/Kconfig @@ -6,13 +6,13 @@ menuconfig ZMK_DISPLAY default n select DISPLAY select LVGL - select LVGL_THEMES - select LVGL_THEME_MONO + select LV_THEMES + select LV_THEME_MONO if ZMK_DISPLAY -choice LVGL_TXT_ENC - default LVGL_TXT_ENC_UTF8 +choice LV_TXT_ENC + default LV_TXT_ENC_UTF8 endchoice @@ -21,7 +21,7 @@ choice ZMK_DISPLAY_STATUS_SCREEN config ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN bool "Built in status screen" - select LVGL_OBJ_LABEL + select LV_OBJ_LABEL config ZMK_DISPLAY_STATUS_SCREEN_CUSTOM bool "Custom status screen" @@ -53,21 +53,21 @@ endif # ZMK_DISPLAY_WORK_QUEUE_DEDICATED if ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN -config LVGL_FONT_MONTSERRAT_16 - default y +# config LV_FONT_MONTSERRAT_16 +# default y -choice LVGL_THEME_DEFAULT_FONT_NORMAL - default LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_16 +# choice LV_THEME_DEFAULT_FONT_NORMAL +# default LV_FONT_MONTSERRAT_16 -endchoice +# endchoice -config LVGL_FONT_MONTSERRAT_12 - default y +# config LV_FONT_MONTSERRAT_12 +# default y -choice LVGL_THEME_DEFAULT_FONT_SMALL - default LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_12 +# choice LV_THEME_DEFAULT_FONT_SMALL +# default LV_FONT_MONTSERRAT_12 -endchoice +# endchoice endif # ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN diff --git a/app/src/display/main.c b/app/src/display/main.c index 5dfad910..890fa378 100644 --- a/app/src/display/main.c +++ b/app/src/display/main.c @@ -19,7 +19,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include -#define ZMK_DISPLAY_NAME CONFIG_LVGL_DISPLAY_DEV_NAME +#define ZMK_DISPLAY_NAME CONFIG_LV_Z_DISPLAY_DEV_NAME static const struct device *display; static bool initialized = false; @@ -51,7 +51,7 @@ struct k_work_q *zmk_display_work_q() { } void display_timer_cb() { - lv_tick_inc(TICK_MS); + //lv_tick_inc(TICK_MS); k_work_submit_to_queue(zmk_display_work_q(), &display_tick_work); } diff --git a/app/src/display/status_screen.c b/app/src/display/status_screen.c index ff678afa..d1373148 100644 --- a/app/src/display/status_screen.c +++ b/app/src/display/status_screen.c @@ -29,35 +29,38 @@ static struct zmk_widget_layer_status layer_status_widget; static struct zmk_widget_wpm_status wpm_status_widget; #endif +lv_style_t global_style; + lv_obj_t *zmk_display_status_screen() { lv_obj_t *screen; - screen = lv_obj_create(NULL, NULL); + lv_style_init(&global_style); + lv_style_set_text_font(&global_style, &lv_font_montserrat_32); + + screen = lv_obj_create(NULL); + lv_obj_add_style(screen, &global_style, LV_PART_MAIN); #if IS_ENABLED(CONFIG_ZMK_WIDGET_BATTERY_STATUS) zmk_widget_battery_status_init(&battery_status_widget, screen); - lv_obj_align(zmk_widget_battery_status_obj(&battery_status_widget), NULL, LV_ALIGN_IN_TOP_RIGHT, + lv_obj_align(zmk_widget_battery_status_obj(&battery_status_widget), LV_ALIGN_TOP_RIGHT, 0, 0); #endif #if IS_ENABLED(CONFIG_ZMK_WIDGET_OUTPUT_STATUS) zmk_widget_output_status_init(&output_status_widget, screen); - lv_obj_align(zmk_widget_output_status_obj(&output_status_widget), NULL, LV_ALIGN_IN_TOP_LEFT, 0, + lv_obj_align(zmk_widget_output_status_obj(&output_status_widget), LV_ALIGN_TOP_LEFT, 0, 0); #endif #if IS_ENABLED(CONFIG_ZMK_WIDGET_LAYER_STATUS) zmk_widget_layer_status_init(&layer_status_widget, screen); - lv_obj_set_style_local_text_font(zmk_widget_layer_status_obj(&layer_status_widget), - LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, - lv_theme_get_font_small()); - lv_obj_align(zmk_widget_layer_status_obj(&layer_status_widget), NULL, LV_ALIGN_IN_BOTTOM_LEFT, + lv_obj_align(zmk_widget_layer_status_obj(&layer_status_widget), LV_ALIGN_BOTTOM_LEFT, 0, 0); #endif #if IS_ENABLED(CONFIG_ZMK_WIDGET_WPM_STATUS) zmk_widget_wpm_status_init(&wpm_status_widget, screen); - lv_obj_align(zmk_widget_wpm_status_obj(&wpm_status_widget), NULL, LV_ALIGN_IN_BOTTOM_RIGHT, -12, + lv_obj_align(zmk_widget_wpm_status_obj(&wpm_status_widget), LV_ALIGN_BOTTOM_RIGHT, 0, 0); #endif return screen; diff --git a/app/src/display/widgets/Kconfig b/app/src/display/widgets/Kconfig index 0a6bf5c4..55267e2f 100644 --- a/app/src/display/widgets/Kconfig +++ b/app/src/display/widgets/Kconfig @@ -7,24 +7,24 @@ config ZMK_WIDGET_LAYER_STATUS bool "Widget for highest, active layer using small icons" default y depends on !ZMK_SPLIT || ZMK_SPLIT_BLE_ROLE_CENTRAL - select LVGL_USE_LABEL + select LV_USE_LABEL config ZMK_WIDGET_BATTERY_STATUS bool "Widget for battery charge information, using small icons" depends on BT default y if BT - select LVGL_USE_LABEL + select LV_USE_LABEL config ZMK_WIDGET_OUTPUT_STATUS bool "Widget for keyboard output status icons" depends on BT default y if BT - select LVGL_USE_LABEL + select LV_USE_LABEL config ZMK_WIDGET_WPM_STATUS bool "Widget for displaying typed words per minute" depends on !ZMK_SPLIT || ZMK_SPLIT_BLE_ROLE_CENTRAL - select LVGL_USE_LABEL + select LV_USE_LABEL select ZMK_WPM endmenu diff --git a/app/src/display/widgets/battery_status.c b/app/src/display/widgets/battery_status.c index d74cc8ed..95af2eec 100644 --- a/app/src/display/widgets/battery_status.c +++ b/app/src/display/widgets/battery_status.c @@ -27,7 +27,7 @@ struct battery_status_state { }; static void set_battery_symbol(lv_obj_t *label, struct battery_status_state state) { - char text[2] = " "; + char text[3] = ""; uint8_t level = state.level; @@ -38,15 +38,15 @@ static void set_battery_symbol(lv_obj_t *label, struct battery_status_state stat #endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */ if (level > 95) { - strcat(text, LV_SYMBOL_BATTERY_FULL); + strcat(text, " " LV_SYMBOL_BATTERY_FULL); } else if (level > 65) { - strcat(text, LV_SYMBOL_BATTERY_3); + strcat(text, " " LV_SYMBOL_BATTERY_3); } else if (level > 35) { - strcat(text, LV_SYMBOL_BATTERY_2); + strcat(text, " " LV_SYMBOL_BATTERY_2); } else if (level > 5) { - strcat(text, LV_SYMBOL_BATTERY_1); + strcat(text, " " LV_SYMBOL_BATTERY_1); } else { - strcat(text, LV_SYMBOL_BATTERY_EMPTY); + strcat(text, " " LV_SYMBOL_BATTERY_EMPTY); } lv_label_set_text(label, text); } @@ -74,7 +74,7 @@ ZMK_SUBSCRIPTION(widget_battery_status, zmk_usb_conn_state_changed); #endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */ int zmk_widget_battery_status_init(struct zmk_widget_battery_status *widget, lv_obj_t *parent) { - widget->obj = lv_label_create(parent, NULL); + widget->obj = lv_label_create(parent); lv_obj_set_size(widget->obj, 40, 15); diff --git a/app/src/display/widgets/layer_status.c b/app/src/display/widgets/layer_status.c index 32bdb828..8832441a 100644 --- a/app/src/display/widgets/layer_status.c +++ b/app/src/display/widgets/layer_status.c @@ -26,13 +26,13 @@ static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) { if (state.label == NULL) { char text[6] = {}; - sprintf(text, LV_SYMBOL_KEYBOARD "%i", state.index); + sprintf(text, LV_SYMBOL_KEYBOARD " %i", state.index); lv_label_set_text(label, text); } else { char text[12] = {}; - snprintf(text, 12, LV_SYMBOL_KEYBOARD "%s", state.label); + snprintf(text, 12, LV_SYMBOL_KEYBOARD " %s", state.label); lv_label_set_text(label, text); } @@ -54,7 +54,7 @@ ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, laye ZMK_SUBSCRIPTION(widget_layer_status, zmk_layer_state_changed); int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_t *parent) { - widget->obj = lv_label_create(parent, NULL); + widget->obj = lv_label_create(parent); lv_obj_set_size(widget->obj, 40, 15); diff --git a/app/src/display/widgets/output_status.c b/app/src/display/widgets/output_status.c index fe99ac96..6ca3c411 100644 --- a/app/src/display/widgets/output_status.c +++ b/app/src/display/widgets/output_status.c @@ -39,23 +39,23 @@ static struct output_status_state get_state(const zmk_event_t *_eh) { } static void set_status_symbol(lv_obj_t *label, struct output_status_state state) { - char text[9] = {}; + char text[10] = {}; switch (state.selected_endpoint) { case ZMK_ENDPOINT_USB: - strcat(text, LV_SYMBOL_USB " "); + strcat(text, LV_SYMBOL_USB " "); break; case ZMK_ENDPOINT_BLE: if (state.active_profile_bonded) { if (state.active_profile_connected) { - snprintf(text, sizeof(text), LV_SYMBOL_WIFI "%i " LV_SYMBOL_OK, + snprintf(text, sizeof(text), LV_SYMBOL_WIFI " %i " LV_SYMBOL_OK, state.active_profile_index); } else { - snprintf(text, sizeof(text), LV_SYMBOL_WIFI "%i " LV_SYMBOL_CLOSE, + snprintf(text, sizeof(text), LV_SYMBOL_WIFI " %i " LV_SYMBOL_CLOSE, state.active_profile_index); } } else { - snprintf(text, sizeof(text), LV_SYMBOL_WIFI "%i " LV_SYMBOL_SETTINGS, + snprintf(text, sizeof(text), LV_SYMBOL_WIFI " %i " LV_SYMBOL_SETTINGS, state.active_profile_index); } break; @@ -81,7 +81,7 @@ ZMK_SUBSCRIPTION(widget_output_status, zmk_ble_active_profile_changed); #endif int zmk_widget_output_status_init(struct zmk_widget_output_status *widget, lv_obj_t *parent) { - widget->obj = lv_label_create(parent, NULL); + widget->obj = lv_label_create(parent); lv_obj_set_size(widget->obj, 40, 15); diff --git a/app/src/display/widgets/wpm_status.c b/app/src/display/widgets/wpm_status.c index 7ed047c3..21c5d2f7 100644 --- a/app/src/display/widgets/wpm_status.c +++ b/app/src/display/widgets/wpm_status.c @@ -24,13 +24,14 @@ struct wpm_status_state wpm_status_get_state(const zmk_event_t *eh) { return (struct wpm_status_state){.wpm = zmk_wpm_get_state()}; }; -void set_wpm_symbol(lv_obj_t *label, struct wpm_status_state state) { +void set_wpm_symbol(lv_obj_t *obj, struct wpm_status_state state) { char text[4] = {}; LOG_DBG("WPM changed to %i", state.wpm); - snprintf(text, sizeof(text), "%i ", state.wpm); + snprintf(text, sizeof(text), "%i", state.wpm); - lv_label_set_text(label, text); + lv_span_t *span = lv_spangroup_get_child(obj, 0); + lv_span_set_text(span, text); } void wpm_status_update_cb(struct wpm_status_state state) { @@ -43,10 +44,11 @@ ZMK_DISPLAY_WIDGET_LISTENER(widget_wpm_status, struct wpm_status_state, wpm_stat ZMK_SUBSCRIPTION(widget_wpm_status, zmk_wpm_state_changed); int zmk_widget_wpm_status_init(struct zmk_widget_wpm_status *widget, lv_obj_t *parent) { - widget->obj = lv_label_create(parent, NULL); - lv_label_set_align(widget->obj, LV_LABEL_ALIGN_RIGHT); - - lv_obj_set_size(widget->obj, 40, 15); + widget->obj = lv_spangroup_create(parent); + lv_spangroup_new_span(widget->obj); + lv_spangroup_set_align(widget->obj, LV_TEXT_ALIGN_RIGHT); + lv_spangroup_set_mode(widget->obj, LV_SPAN_MODE_EXPAND); + lv_obj_set_size(widget->obj, 60, 32); sys_slist_append(&widgets, &widget->node); diff --git a/app/west.yml b/app/west.yml index f7e1ae12..298cbfd2 100644 --- a/app/west.yml +++ b/app/west.yml @@ -4,10 +4,12 @@ manifest: url-base: https://github.com/zephyrproject-rtos - name: zmkfirmware url-base: https://github.com/zmkfirmware + - name: nicell + url-base: https://github.com/nicell projects: - name: zephyr - remote: zmkfirmware - revision: v3.0.0+zmk-fixes + remote: nicell + revision: v3.0.0+zmk-fixes+lvgl clone-depth: 1 import: # TODO: Rename once upstream offers option like `exclude` or `denylist`