refactor(display): Updates for LVGL v8.x changes.
* LV_ prefix from new LVGL official Kconfig now used. * API changes for themes, container object removal, etc. * Add our own Kconfig and code for theme default small font. * Remove some hardcoded sizes.
This commit is contained in:
parent
168b32b828
commit
69a4c3200d
44 changed files with 463 additions and 246 deletions
|
@ -42,12 +42,12 @@ config USB_DEVICE_STACK
|
|||
endif # USB
|
||||
|
||||
config ZMK_DISPLAY
|
||||
select LVGL_USE_CONT
|
||||
select LVGL_FONT_MONTSERRAT_26
|
||||
select LVGL_FONT_MONTSERRAT_20
|
||||
select LVGL_FONT_MONTSERRAT_16
|
||||
select LVGL_USE_LABEL
|
||||
select LVGL_USE_IMG
|
||||
select LV_USE_CONT
|
||||
select LV_FONT_MONTSERRAT_26
|
||||
select LV_FONT_MONTSERRAT_20
|
||||
select LV_FONT_MONTSERRAT_16
|
||||
select LV_USE_LABEL
|
||||
select LV_USE_IMG
|
||||
|
||||
choice ZMK_DISPLAY_STATUS_SCREEN
|
||||
default ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
|
||||
|
|
|
@ -39,17 +39,15 @@ CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
|
|||
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048
|
||||
CONFIG_SSD1306=n
|
||||
CONFIG_IL0323=y
|
||||
CONFIG_LVGL_BITS_PER_PIXEL=1
|
||||
CONFIG_LVGL_COLOR_DEPTH_1=y
|
||||
CONFIG_LVGL_DPI=145
|
||||
CONFIG_LVGL_VDB_SIZE=100
|
||||
CONFIG_LVGL_USE_THEME_MONO=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_PRIMARY_RED=n
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_SECONDARY_RED=n
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_PRIMARY_BLACK=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_SECONDARY_WHITE=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_16=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y
|
||||
CONFIG_LV_Z_BITS_PER_PIXEL=1
|
||||
CONFIG_LV_COLOR_DEPTH_1=y
|
||||
CONFIG_LV_DPI_DEF=145
|
||||
CONFIG_LV_Z_VDB_SIZE=100
|
||||
CONFIG_LV_USE_THEME_MONO=y
|
||||
CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00
|
||||
CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_26=y
|
||||
CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y
|
||||
|
||||
# custom status screens
|
||||
CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y
|
||||
|
|
|
@ -39,17 +39,15 @@ CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
|
|||
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048
|
||||
CONFIG_SSD1306=n
|
||||
CONFIG_IL0323=y
|
||||
CONFIG_LVGL_BITS_PER_PIXEL=1
|
||||
CONFIG_LVGL_COLOR_DEPTH_1=y
|
||||
CONFIG_LVGL_DPI=145
|
||||
CONFIG_LVGL_VDB_SIZE=100
|
||||
CONFIG_LVGL_USE_THEME_MONO=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_PRIMARY_RED=n
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_SECONDARY_RED=n
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_PRIMARY_BLACK=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_COLOR_SECONDARY_WHITE=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_16=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y
|
||||
CONFIG_LV_Z_BITS_PER_PIXEL=1
|
||||
CONFIG_LV_COLOR_DEPTH_1=y
|
||||
CONFIG_LV_DPI_DEF=145
|
||||
CONFIG_LV_Z_VDB_SIZE=100
|
||||
CONFIG_LV_USE_THEME_MONO=y
|
||||
CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00
|
||||
CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_26=y
|
||||
CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y
|
||||
|
||||
# custom status screens
|
||||
CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "widgets/layer_status.h"
|
||||
#include "custom_status_screen.h"
|
||||
|
||||
#include <logging/log.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
||||
LV_IMG_DECLARE(zenlogo);
|
||||
|
@ -36,50 +36,42 @@ static struct zmk_widget_layer_status layer_status_widget;
|
|||
lv_obj_t *zmk_display_status_screen() {
|
||||
|
||||
lv_obj_t *screen;
|
||||
screen = lv_obj_create(NULL, NULL);
|
||||
screen = lv_obj_create(NULL);
|
||||
|
||||
#if IS_ENABLED(CONFIG_CUSTOM_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_MID,
|
||||
0, 2);
|
||||
lv_obj_align(zmk_widget_battery_status_obj(&battery_status_widget), LV_ALIGN_TOP_MID, 0, 2);
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_CUSTOM_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_MID, 0,
|
||||
41);
|
||||
lv_obj_align(zmk_widget_output_status_obj(&output_status_widget), LV_ALIGN_TOP_MID, 0, 41);
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_CUSTOM_WIDGET_PERIPHERAL_STATUS)
|
||||
zmk_widget_peripheral_status_init(&peripheral_status_widget, screen);
|
||||
lv_obj_align(zmk_widget_peripheral_status_obj(&peripheral_status_widget), NULL,
|
||||
LV_ALIGN_IN_TOP_MID, 0, 41);
|
||||
lv_obj_align(zmk_widget_peripheral_status_obj(&peripheral_status_widget), LV_ALIGN_TOP_MID, 0,
|
||||
41);
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_CUSTOM_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_MID, 0,
|
||||
-5);
|
||||
|
||||
lv_obj_t *LayersHeading;
|
||||
LayersHeading = lv_img_create(screen, NULL);
|
||||
lv_obj_align(LayersHeading, NULL, LV_ALIGN_IN_BOTTOM_MID, 8, 5);
|
||||
LayersHeading = lv_img_create(screen);
|
||||
lv_obj_align(LayersHeading, LV_ALIGN_BOTTOM_MID, 0, -30);
|
||||
lv_img_set_src(LayersHeading, &layers2);
|
||||
|
||||
zmk_widget_layer_status_init(&layer_status_widget, screen);
|
||||
lv_obj_set_style_text_font(zmk_widget_layer_status_obj(&layer_status_widget),
|
||||
&lv_font_montserrat_16, LV_PART_MAIN);
|
||||
lv_obj_align(zmk_widget_layer_status_obj(&layer_status_widget), LV_ALIGN_BOTTOM_MID, 0, -5);
|
||||
#endif
|
||||
|
||||
#if !IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
|
||||
lv_obj_t *zenlogo_icon;
|
||||
zenlogo_icon = lv_img_create(screen, NULL);
|
||||
zenlogo_icon = lv_img_create(screen);
|
||||
lv_img_set_src(zenlogo_icon, &zenlogo);
|
||||
lv_obj_align(zenlogo_icon, NULL, LV_ALIGN_IN_BOTTOM_MID, 2, -5);
|
||||
lv_obj_align(zenlogo_icon, LV_ALIGN_BOTTOM_MID, 2, -5);
|
||||
#endif
|
||||
|
||||
// lv_task_handler();
|
||||
lv_refr_now(NULL);
|
||||
// display_blanking_off(display_dev);
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
|
|
@ -5,15 +5,14 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <bluetooth/services/bas.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/bluetooth/services/bas.h>
|
||||
|
||||
#include <logging/log.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
||||
#include <zmk/display.h>
|
||||
#include "battery_status.h"
|
||||
#include <src/lv_themes/lv_theme.h>
|
||||
#include <zmk/usb.h>
|
||||
#include <zmk/events/usb_conn_state_changed.h>
|
||||
#include <zmk/event_manager.h>
|
||||
|
@ -84,7 +83,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_img_create(parent, NULL);
|
||||
widget->obj = lv_img_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
widget_battery_status_init();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <kernel.h>
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
struct zmk_widget_battery_status {
|
||||
sys_snode_t node;
|
||||
|
@ -17,4 +17,4 @@ struct zmk_widget_battery_status {
|
|||
};
|
||||
|
||||
int zmk_widget_battery_status_init(struct zmk_widget_battery_status *widget, lv_obj_t *parent);
|
||||
lv_obj_t *zmk_widget_battery_status_obj(struct zmk_widget_battery_status *widget);
|
||||
lv_obj_t *zmk_widget_battery_status_obj(struct zmk_widget_battery_status *widget);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <logging/log.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
||||
#include <zmk/display.h>
|
||||
|
@ -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);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
@ -64,4 +64,4 @@ int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_
|
|||
|
||||
lv_obj_t *zmk_widget_layer_status_obj(struct zmk_widget_layer_status *widget) {
|
||||
return widget->obj;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <kernel.h>
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
struct zmk_widget_layer_status {
|
||||
sys_snode_t node;
|
||||
|
@ -16,4 +16,4 @@ struct zmk_widget_layer_status {
|
|||
};
|
||||
|
||||
int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_t *parent);
|
||||
lv_obj_t *zmk_widget_layer_status_obj(struct zmk_widget_layer_status *widget);
|
||||
lv_obj_t *zmk_widget_layer_status_obj(struct zmk_widget_layer_status *widget);
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <bluetooth/services/bas.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/bluetooth/services/bas.h>
|
||||
|
||||
#include <logging/log.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
||||
#include <zmk/display.h>
|
||||
|
@ -123,9 +123,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_img_create(parent, NULL);
|
||||
|
||||
lv_obj_set_size(widget->obj, 40, 15);
|
||||
widget->obj = lv_img_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <kernel.h>
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
struct zmk_widget_output_status {
|
||||
sys_snode_t node;
|
||||
|
@ -16,4 +16,4 @@ struct zmk_widget_output_status {
|
|||
};
|
||||
|
||||
int zmk_widget_output_status_init(struct zmk_widget_output_status *widget, lv_obj_t *parent);
|
||||
lv_obj_t *zmk_widget_output_status_obj(struct zmk_widget_output_status *widget);
|
||||
lv_obj_t *zmk_widget_output_status_obj(struct zmk_widget_output_status *widget);
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <bluetooth/services/bas.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/bluetooth/services/bas.h>
|
||||
|
||||
#include <logging/log.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
||||
#include <zmk/display.h>
|
||||
|
@ -48,7 +48,7 @@ ZMK_SUBSCRIPTION(widget_peripheral_status, zmk_split_peripheral_status_changed);
|
|||
|
||||
int zmk_widget_peripheral_status_init(struct zmk_widget_peripheral_status *widget,
|
||||
lv_obj_t *parent) {
|
||||
widget->obj = lv_img_create(parent, NULL);
|
||||
widget->obj = lv_img_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <kernel.h>
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
struct zmk_widget_peripheral_status {
|
||||
sys_snode_t node;
|
||||
|
@ -17,4 +17,4 @@ struct zmk_widget_peripheral_status {
|
|||
|
||||
int zmk_widget_peripheral_status_init(struct zmk_widget_peripheral_status *widget,
|
||||
lv_obj_t *parent);
|
||||
lv_obj_t *zmk_widget_peripheral_status_obj(struct zmk_widget_peripheral_status *widget);
|
||||
lv_obj_t *zmk_widget_peripheral_status_obj(struct zmk_widget_peripheral_status *widget);
|
||||
|
|
|
@ -28,17 +28,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -31,17 +31,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -29,17 +29,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -21,17 +21,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -29,17 +29,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -32,17 +32,17 @@ endif # ZMK_DISPLAY
|
|||
if LVGL
|
||||
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -29,17 +29,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -31,17 +31,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -31,17 +31,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -21,17 +21,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -25,17 +25,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
if SHIELD_NICE_VIEW
|
||||
|
||||
config ZMK_DISPLAY
|
||||
select LVGL_FONT_MONTSERRAT_26
|
||||
select LV_FONT_MONTSERRAT_26
|
||||
|
||||
if ZMK_DISPLAY
|
||||
|
||||
|
@ -17,11 +17,11 @@ config LS0XX
|
|||
config ZMK_WIDGET_WPM_STATUS
|
||||
default y if !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # ZMK_DISPLAY
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Enable nice!view
|
||||
CONFIG_ZMK_DISPLAY=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_26=y
|
||||
CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y
|
||||
CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26=y
|
||||
CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26=y
|
||||
CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n
|
||||
|
|
|
@ -31,17 +31,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -31,17 +31,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -37,17 +37,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -37,17 +37,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -37,17 +37,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -22,17 +22,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -29,17 +29,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -31,17 +31,17 @@ endif # ZMK_DISPLAY
|
|||
|
||||
if LVGL
|
||||
|
||||
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
|
||||
default LV_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
|
@ -6,8 +6,9 @@ menuconfig ZMK_DISPLAY
|
|||
default n
|
||||
select DISPLAY
|
||||
select LVGL
|
||||
select LVGL_THEMES
|
||||
select LVGL_THEME_MONO
|
||||
select LV_THEMES
|
||||
select LV_THEME_MONO
|
||||
select LV_CONF_MINIMAL
|
||||
|
||||
if ZMK_DISPLAY
|
||||
|
||||
|
@ -15,17 +16,26 @@ config ZMK_DISPLAY_BLANK_ON_IDLE
|
|||
bool "Blank display on idle"
|
||||
default y if SSD1306
|
||||
|
||||
choice LVGL_TXT_ENC
|
||||
default LVGL_TXT_ENC_UTF8
|
||||
choice LV_TXT_ENC
|
||||
default LV_TXT_ENC_UTF8
|
||||
|
||||
endchoice
|
||||
|
||||
config LV_MEM_CUSTOM
|
||||
default y
|
||||
|
||||
config LV_Z_MEM_POOL_MIN_SIZE
|
||||
default 32
|
||||
|
||||
config LV_Z_MEM_POOL_MAX_SIZE
|
||||
default 8192
|
||||
|
||||
choice ZMK_DISPLAY_STATUS_SCREEN
|
||||
prompt "Default status screen for displays"
|
||||
|
||||
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"
|
||||
|
@ -57,24 +67,105 @@ endif # ZMK_DISPLAY_WORK_QUEUE_DEDICATED
|
|||
|
||||
if ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN
|
||||
|
||||
config LVGL_FONT_MONTSERRAT_16
|
||||
config LV_FONT_MONTSERRAT_16
|
||||
default y
|
||||
|
||||
choice LVGL_THEME_DEFAULT_FONT_NORMAL
|
||||
default LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_16
|
||||
choice LV_FONT_DEFAULT
|
||||
default LV_FONT_DEFAULT_MONTSERRAT_16
|
||||
|
||||
endchoice
|
||||
|
||||
config LVGL_FONT_MONTSERRAT_12
|
||||
config LV_FONT_MONTSERRAT_12
|
||||
default y
|
||||
|
||||
choice LVGL_THEME_DEFAULT_FONT_SMALL
|
||||
default LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_12
|
||||
|
||||
endchoice
|
||||
|
||||
endif # ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN
|
||||
|
||||
choice ZMK_LV_FONT_DEFAULT_SMALL
|
||||
prompt "Select theme default small font"
|
||||
default ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12
|
||||
help
|
||||
Select theme default small font
|
||||
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_8
|
||||
bool "Montserrat 8"
|
||||
select LV_FONT_MONTSERRAT_8
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12
|
||||
bool "Montserrat 12"
|
||||
select LV_FONT_MONTSERRAT_12
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_14
|
||||
bool "Montserrat 14"
|
||||
select LV_FONT_MONTSERRAT_14
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16
|
||||
bool "Montserrat 16"
|
||||
select LV_FONT_MONTSERRAT_16
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_18
|
||||
bool "Montserrat 18"
|
||||
select LV_FONT_MONTSERRAT_18
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_20
|
||||
bool "Montserrat 20"
|
||||
select LV_FONT_MONTSERRAT_20
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_22
|
||||
bool "Montserrat 22"
|
||||
select LV_FONT_MONTSERRAT_22
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_24
|
||||
bool "Montserrat 24"
|
||||
select LV_FONT_MONTSERRAT_24
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26
|
||||
bool "Montserrat 26"
|
||||
select LV_FONT_MONTSERRAT_26
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28
|
||||
bool "Montserrat 28"
|
||||
select LV_FONT_MONTSERRAT_28
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_30
|
||||
bool "Montserrat 30"
|
||||
select LV_FONT_MONTSERRAT_30
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_32
|
||||
bool "Montserrat 32"
|
||||
select LV_FONT_MONTSERRAT_32
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_34
|
||||
bool "Montserrat 34"
|
||||
select LV_FONT_MONTSERRAT_34
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_36
|
||||
bool "Montserrat 36"
|
||||
select LV_FONT_MONTSERRAT_36
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_38
|
||||
bool "Montserrat 38"
|
||||
select LV_FONT_MONTSERRAT_38
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_40
|
||||
bool "Montserrat 40"
|
||||
select LV_FONT_MONTSERRAT_40
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_42
|
||||
bool "Montserrat 42"
|
||||
select LV_FONT_MONTSERRAT_42
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_44
|
||||
bool "Montserrat 44"
|
||||
select LV_FONT_MONTSERRAT_44
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_46
|
||||
bool "Montserrat 46"
|
||||
select LV_FONT_MONTSERRAT_46
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_48
|
||||
bool "Montserrat 48"
|
||||
select LV_FONT_MONTSERRAT_48
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12_SUBPX
|
||||
bool "Montserrat 12 sub-pixel"
|
||||
select LV_FONT_MONTSERRAT_12_SUBPX
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28_COMPRESSED
|
||||
bool "Montserrat 28 compressed"
|
||||
select LV_FONT_MONTSERRAT_28_COMPRESSED
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_DEJAVU_16_PERSIAN_HEBREW
|
||||
bool "Dejavu 16 Persian, Hebrew, Arabic letters"
|
||||
select LV_FONT_DEJAVU_16_PERSIAN_HEBREW
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_SIMSUN_16_CJK
|
||||
bool "Simsun 16 CJK"
|
||||
select LV_FONT_SIMSUN_16_CJK
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_UNSCII_8
|
||||
bool "UNSCII 8 (Perfect monospace font)"
|
||||
select LV_FONT_UNSCII_8
|
||||
config ZMK_LV_FONT_DEFAULT_SMALL_UNSCII_16
|
||||
bool "UNSCII 16 (Perfect monospace font)"
|
||||
select LV_FONT_UNSCII_16
|
||||
endchoice
|
||||
|
||||
rsource "widgets/Kconfig"
|
||||
|
||||
endif
|
||||
|
|
|
@ -15,11 +15,13 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|||
#include <drivers/display.h>
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "theme.h"
|
||||
|
||||
#include <zmk/event_manager.h>
|
||||
#include <zmk/events/activity_state_changed.h>
|
||||
#include <zmk/display/status_screen.h>
|
||||
|
||||
#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;
|
||||
|
@ -50,16 +52,21 @@ struct k_work_q *zmk_display_work_q() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void display_timer_cb() {
|
||||
lv_tick_inc(TICK_MS);
|
||||
k_work_submit_to_queue(zmk_display_work_q(), &display_tick_work);
|
||||
}
|
||||
|
||||
void blank_display_cb(struct k_work *work) { display_blanking_on(display); }
|
||||
|
||||
void unblank_display_cb(struct k_work *work) { display_blanking_off(display); }
|
||||
void display_timer_cb() { k_work_submit_to_queue(zmk_display_work_q(), &display_tick_work); }
|
||||
|
||||
K_TIMER_DEFINE(display_timer, display_timer_cb, NULL);
|
||||
|
||||
void unblank_display_cb(struct k_work *work) {
|
||||
display_blanking_off(display);
|
||||
k_timer_start(&display_timer, K_MSEC(TICK_MS), K_MSEC(TICK_MS));
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE)
|
||||
|
||||
void blank_display_cb(struct k_work *work) {
|
||||
k_timer_stop(&display_timer);
|
||||
display_blanking_on(display);
|
||||
}
|
||||
K_WORK_DEFINE(blank_display_work, blank_display_cb);
|
||||
K_WORK_DEFINE(unblank_display_work, unblank_display_cb);
|
||||
|
||||
|
@ -69,26 +76,30 @@ static void start_display_updates() {
|
|||
}
|
||||
|
||||
k_work_submit_to_queue(zmk_display_work_q(), &unblank_display_work);
|
||||
|
||||
k_timer_start(&display_timer, K_MSEC(TICK_MS), K_MSEC(TICK_MS));
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE)
|
||||
|
||||
static void stop_display_updates() {
|
||||
if (display == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
k_work_submit_to_queue(zmk_display_work_q(), &blank_display_work);
|
||||
|
||||
k_timer_stop(&display_timer);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int zmk_display_is_initialized() { return initialized; }
|
||||
|
||||
static void initialize_theme() {
|
||||
#if IS_ENABLED(CONFIG_LV_USE_THEME_MONO)
|
||||
lv_disp_t *disp = lv_disp_get_default();
|
||||
lv_theme_t *theme = lv_theme_mono_init(disp, false, CONFIG_LV_FONT_DEFAULT);
|
||||
theme->font_small = CONFIG_ZMK_LV_FONT_DEFAULT_SMALL;
|
||||
|
||||
disp->theme = theme;
|
||||
#endif // CONFIG_LV_USE_THEME_MONO
|
||||
}
|
||||
|
||||
void initialize_display(struct k_work *work) {
|
||||
LOG_DBG("");
|
||||
|
||||
|
@ -100,6 +111,8 @@ void initialize_display(struct k_work *work) {
|
|||
|
||||
initialized = true;
|
||||
|
||||
initialize_theme();
|
||||
|
||||
screen = zmk_display_status_screen();
|
||||
|
||||
if (screen == NULL) {
|
||||
|
@ -109,7 +122,7 @@ void initialize_display(struct k_work *work) {
|
|||
|
||||
lv_scr_load(screen);
|
||||
|
||||
start_display_updates();
|
||||
unblank_display_cb(work);
|
||||
}
|
||||
|
||||
K_WORK_DEFINE(init_work, initialize_display);
|
||||
|
|
|
@ -34,42 +34,43 @@ 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_12);
|
||||
|
||||
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,
|
||||
0, 0);
|
||||
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,
|
||||
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_PERIPHERAL_STATUS)
|
||||
zmk_widget_peripheral_status_init(&peripheral_status_widget, screen);
|
||||
lv_obj_align(zmk_widget_peripheral_status_obj(&peripheral_status_widget), NULL,
|
||||
LV_ALIGN_IN_TOP_LEFT, 0, 0);
|
||||
lv_obj_align(zmk_widget_peripheral_status_obj(&peripheral_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,
|
||||
0, 0);
|
||||
lv_obj_set_style_text_font(zmk_widget_layer_status_obj(&layer_status_widget),
|
||||
lv_theme_get_font_small(screen), LV_PART_MAIN);
|
||||
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, 0,
|
||||
0);
|
||||
lv_obj_align(zmk_widget_wpm_status_obj(&wpm_status_widget), LV_ALIGN_BOTTOM_RIGHT, 0, 0);
|
||||
#endif
|
||||
return screen;
|
||||
}
|
||||
|
|
73
app/src/display/theme.c
Normal file
73
app/src/display/theme.c
Normal file
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#if defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_8)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_8
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_10)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_10
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_12
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_14)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_14
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_16
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_18)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_18
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_20)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_20
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_22)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_22
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_24)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_24
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_26
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_28
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_30)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_30
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_32)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_32
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_34)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_34
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_36)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_36
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_38)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_38
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_40)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_40
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_42)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_42
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_44)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_44
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_46)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_46
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_48)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_48
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12_SUBPX)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_12_subpx
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28_COMPRESSED)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_28_compressed
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_DEJAVU_16_PERSIAN_HEBREW)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_dejavu_16_persian_hebrew
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_SIMSUN_16_CJK)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_simsun_16_cjk
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_UNSCII_8)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_unscii_8
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_UNSCII_16)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_unscii_16
|
||||
#endif
|
||||
|
||||
void zmk_display_theme_init(lv_obj_t *obj) {
|
||||
lv_theme_t *theme = lv_theme_get_from_obj(obj);
|
||||
|
||||
if (theme == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
theme->font_small = CONFIG_ZMK_LV_FONT_DEFAULT_SMALL;
|
||||
}
|
65
app/src/display/theme.h
Normal file
65
app/src/display/theme.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#if defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_8)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_8
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_10)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_10
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_12
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_14)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_14
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_16)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_16
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_18)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_18
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_20)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_20
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_22)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_22
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_24)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_24
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_26)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_26
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_28
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_30)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_30
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_32)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_32
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_34)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_34
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_36)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_36
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_38)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_38
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_40)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_40
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_42)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_42
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_44)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_44
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_46)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_46
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_48)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_48
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_12_SUBPX)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_12_subpx
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_MONTSERRAT_28_COMPRESSED)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_montserrat_28_compressed
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_DEJAVU_16_PERSIAN_HEBREW)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_dejavu_16_persian_hebrew
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_SIMSUN_16_CJK)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_simsun_16_cjk
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_UNSCII_8)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_unscii_8
|
||||
#elif defined(CONFIG_ZMK_LV_FONT_DEFAULT_SMALL_UNSCII_16)
|
||||
#define CONFIG_ZMK_LV_FONT_DEFAULT_SMALL &lv_font_unscii_16
|
||||
#endif
|
|
@ -7,13 +7,13 @@ config ZMK_WIDGET_LAYER_STATUS
|
|||
bool "Widget for highest, active layer using small icons"
|
||||
default y
|
||||
depends on !ZMK_SPLIT || ZMK_SPLIT_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
|
||||
|
||||
if ZMK_WIDGET_BATTERY_STATUS
|
||||
|
||||
|
@ -26,18 +26,18 @@ config ZMK_WIDGET_OUTPUT_STATUS
|
|||
bool "Widget for keyboard output status icons"
|
||||
depends on BT && (!ZMK_SPLIT_BLE || ZMK_SPLIT_ROLE_CENTRAL)
|
||||
default y if BT && (!ZMK_SPLIT_BLE || ZMK_SPLIT_ROLE_CENTRAL)
|
||||
select LVGL_USE_LABEL
|
||||
select LV_USE_LABEL
|
||||
|
||||
config ZMK_WIDGET_PERIPHERAL_STATUS
|
||||
bool "Widget for split peripheral status icons"
|
||||
depends on BT && ZMK_SPLIT_BLE && !ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y if BT && ZMK_SPLIT_BLE && !ZMK_SPLIT_ROLE_CENTRAL
|
||||
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_ROLE_CENTRAL
|
||||
select LVGL_USE_LABEL
|
||||
select LV_USE_LABEL
|
||||
select ZMK_WPM
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -55,7 +55,6 @@ static void set_battery_symbol(lv_obj_t *label, struct battery_status_state stat
|
|||
}
|
||||
#endif
|
||||
lv_label_set_text(label, text);
|
||||
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
|
||||
}
|
||||
|
||||
void battery_status_update_cb(struct battery_status_state state) {
|
||||
|
@ -81,9 +80,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);
|
||||
|
||||
lv_obj_set_size(widget->obj, 43, 15);
|
||||
widget->obj = lv_label_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
|
@ -54,9 +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);
|
||||
|
||||
lv_obj_set_size(widget->obj, 40, 15);
|
||||
widget->obj = lv_label_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
|
@ -81,9 +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);
|
||||
|
||||
lv_obj_set_size(widget->obj, 40, 15);
|
||||
widget->obj = lv_label_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
|
@ -45,9 +45,7 @@ ZMK_SUBSCRIPTION(widget_peripheral_status, zmk_split_peripheral_status_changed);
|
|||
|
||||
int zmk_widget_peripheral_status_init(struct zmk_widget_peripheral_status *widget,
|
||||
lv_obj_t *parent) {
|
||||
widget->obj = lv_label_create(parent, NULL);
|
||||
|
||||
lv_obj_set_size(widget->obj, 40, 15);
|
||||
widget->obj = lv_label_create(parent);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ void set_wpm_symbol(lv_obj_t *label, struct wpm_status_state state) {
|
|||
snprintf(text, sizeof(text), "%i", state.wpm);
|
||||
|
||||
lv_label_set_text(label, text);
|
||||
lv_obj_align(label, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
|
||||
lv_obj_align(label, LV_ALIGN_BOTTOM_RIGHT, 0, 0);
|
||||
}
|
||||
|
||||
void wpm_status_update_cb(struct wpm_status_state state) {
|
||||
|
@ -44,10 +44,8 @@ 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_label_create(parent);
|
||||
lv_obj_align(widget->obj, LV_ALIGN_RIGHT_MID, 0, 0);
|
||||
|
||||
sys_slist_append(&widgets, &widget->node);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue