mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Switch to lvgl 7.8.1
This commit is contained in:
parent
ade03960ff
commit
12cb564db8
@ -1,5 +1,7 @@
|
||||
//#include "lv_conf_v7.h"
|
||||
#include "lv_conf_v8.h"
|
||||
#include "lv_conf_v7.h"
|
||||
#define LV_THEME_DEFAULT_FLAGS LV_THEME_DEFAULT_FLAG
|
||||
|
||||
/*#include "lv_conf_v8.h"
|
||||
|
||||
#ifndef LV_CONF_STUB_H
|
||||
#define LV_CONF_STUB_H
|
||||
@ -83,3 +85,4 @@
|
||||
|
||||
#endif
|
||||
#endif
|
||||
*/
|
@ -467,7 +467,11 @@ typedef void* lv_font_user_data_t;
|
||||
*==================*/
|
||||
|
||||
/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
|
||||
typedef uint8_t lv_obj_user_data_t;
|
||||
typedef struct {
|
||||
uint8_t objid:8;
|
||||
uint8_t groupid:8;
|
||||
uint8_t id;
|
||||
} lv_obj_user_data_t;
|
||||
|
||||
/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
|
||||
#define LV_USE_OBJ_REALIGN 1
|
||||
|
@ -71,8 +71,8 @@ lib_deps =
|
||||
git+https://github.com/Bodmer/TFT_eSPI.git
|
||||
git+https://github.com/fvanroie/ConsoleInput.git
|
||||
git+https://github.com/andrethomas/TasmotaSlave.git
|
||||
git+https://github.com/fvanroie/lv_components.git
|
||||
git+https://github.com/lvgl/lvgl.git#dev-v8
|
||||
;git+https://github.com/fvanroie/lv_components.git
|
||||
git+https://github.com/lvgl/lvgl.git
|
||||
;lvgl/lvgl @ ^7.7.2 ; from PIO library
|
||||
;bodmer/TFT_eSPI @ 2.3.4 ; Tft SPI drivers EXACT version 2.3.5 has compile error
|
||||
; ------ Unused / Test libraries
|
||||
|
@ -393,7 +393,7 @@ lv_obj_t * FindButtonLabel(lv_obj_t * btn)
|
||||
{
|
||||
if(btn) {
|
||||
lv_obj_t * label = lv_obj_get_child_back(btn, NULL);
|
||||
#if LVGL_VERSION_MAJOR != 7
|
||||
#if 1
|
||||
if(label) {
|
||||
if(check_obj_type(label, LV_HASP_LABEL)) {
|
||||
return label;
|
||||
@ -437,7 +437,7 @@ static bool haspGetLabelText(lv_obj_t * obj, char * text)
|
||||
|
||||
lv_obj_t * label = lv_obj_get_child_back(obj, NULL);
|
||||
if(label) {
|
||||
#if LVGL_VERSION_MAJOR != 7
|
||||
#if 1
|
||||
if(check_obj_type(label, LV_HASP_LABEL)) {
|
||||
text = lv_label_get_text(label);
|
||||
return true;
|
||||
@ -627,7 +627,7 @@ static void hasp_local_style_attr(lv_obj_t * obj, const char * attr_p, uint16_t
|
||||
return attribute_pad_left(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||
case ATTR_PAD_RIGHT:
|
||||
return attribute_pad_right(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||
#if LVGL_VERSION_MAJOR == 7
|
||||
#if 0
|
||||
case ATTR_PAD_INNER:
|
||||
return attribute_pad_inner(obj, part, state, update, attr_p, (lv_style_int_t)var);
|
||||
#endif
|
||||
|
@ -44,18 +44,18 @@ lv_obj_t * hasp_find_obj_from_parent_id(lv_obj_t * parent, uint8_t objid)
|
||||
|
||||
/* check tabs */
|
||||
if(check_obj_type(child, LV_HASP_TABVIEW)) {
|
||||
#if LVGL_VERSION_MAJOR == 7
|
||||
//#if LVGL_VERSION_MAJOR == 7
|
||||
uint16_t tabcount = lv_tabview_get_tab_count(child);
|
||||
for(uint16_t i = 0; i < tabcount; i++) {
|
||||
lv_obj_t * tab = lv_tabview_get_tab(child, i);
|
||||
Log.verbose(TAG_HASP, "Found tab %i", i);
|
||||
if(tab->user_data && (lv_obj_user_data_t)objid == tab->user_data) return tab; /* tab found, return it */
|
||||
if(tab->user_data.objid && objid == tab->user_data.objid) return tab; /* tab found, return it */
|
||||
|
||||
/* check grandchildren */
|
||||
grandchild = hasp_find_obj_from_parent_id(tab, objid);
|
||||
if(grandchild) return grandchild; /* grandchild found, return it */
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
/* try next sibling */
|
||||
@ -161,7 +161,7 @@ bool check_obj_type_str(const char * lvobjtype, lv_hasp_obj_type_t haspobjtype)
|
||||
*/
|
||||
bool check_obj_type(lv_obj_t * obj, lv_hasp_obj_type_t haspobjtype)
|
||||
{
|
||||
#if LVGL_VERSION_MAJOR != 7
|
||||
#if 1
|
||||
return obj->user_data.objid == (uint8_t)haspobjtype;
|
||||
#else
|
||||
lv_obj_type_t list;
|
||||
@ -193,12 +193,12 @@ void hasp_object_tree(lv_obj_t * parent, uint8_t pageid, uint16_t level)
|
||||
|
||||
/* check tabs */
|
||||
if(check_obj_type(parent, LV_HASP_TABVIEW)) {
|
||||
#if LVGL_VERSION_MAJOR == 7
|
||||
#if 1
|
||||
uint16_t tabcount = lv_tabview_get_tab_count(parent);
|
||||
for(uint16_t i = 0; i < tabcount; i++) {
|
||||
lv_obj_t * tab = lv_tabview_get_tab(child, i);
|
||||
Log.verbose(TAG_HASP, "Found tab %i", i);
|
||||
if(tab->user_data) hasp_object_tree(tab, pageid, level + 1);
|
||||
if(tab->user_data.objid) hasp_object_tree(tab, pageid, level + 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -623,11 +623,11 @@ void hasp_new_object(const JsonObject & config, uint8_t & saved_page_id)
|
||||
if(obj) {
|
||||
lv_obj_t * tab;
|
||||
tab = lv_tabview_add_tab(obj, "tab 1");
|
||||
lv_obj_set_user_data(tab, id + 1);
|
||||
//lv_obj_set_user_data(tab, id + 1);
|
||||
tab = lv_tabview_add_tab(obj, "tab 2");
|
||||
lv_obj_set_user_data(tab, id + 2);
|
||||
//lv_obj_set_user_data(tab, id + 2);
|
||||
tab = lv_tabview_add_tab(obj, "tab 3");
|
||||
lv_obj_set_user_data(tab, id + 3);
|
||||
//lv_obj_set_user_data(tab, id + 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user