forked from kofal.net/zmk
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:
committed by
Pete Johanson
parent
168b32b828
commit
69a4c3200d
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user