prepare to release v7.7.0

This commit is contained in:
Gabor Kiss-Vamosi
2020-10-20 13:32:57 +02:00
parent 64c68ec25b
commit 6fb4235c66
20 changed files with 206 additions and 186 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "lvgl", "name": "lvgl",
"version": "7.6.1", "version": "7.7.0",
"keywords": "graphics, gui, embedded, tft, lvgl", "keywords": "graphics, gui, embedded, tft, lvgl",
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
"repository": { "repository": {
+1 -1
View File
@@ -1,5 +1,5 @@
name=lvgl name=lvgl
version=7.6.1 version=7.7.0
author=kisvegabor author=kisvegabor
maintainer=kisvegabor,embeddedt,pete-pjb maintainer=kisvegabor,embeddedt,pete-pjb
sentence=Full-featured Graphics Library for Embedded Systems sentence=Full-featured Graphics Library for Embedded Systems
+1 -1
View File
@@ -17,7 +17,7 @@ extern "C" {
#define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 7 #define LVGL_VERSION_MINOR 7
#define LVGL_VERSION_PATCH 0 #define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO "dev" #define LVGL_VERSION_INFO ""
/********************* /*********************
* INCLUDES * INCLUDES
+28 -4
View File
@@ -478,7 +478,11 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
/*1: Use PXP for CPU off-load on NXP RTxxx platforms */ /*1: Use PXP for CPU off-load on NXP RTxxx platforms */
#ifndef LV_USE_GPU_NXP_PXP #ifndef LV_USE_GPU_NXP_PXP
#define LV_USE_GPU_NXP_PXP 0 # ifdef CONFIG_LV_USE_GPU_NXP_PXP
# define LV_USE_GPU_NXP_PXP CONFIG_LV_USE_GPU_NXP_PXP
# else
# define LV_USE_GPU_NXP_PXP 0
# endif
#endif #endif
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
@@ -487,12 +491,20 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
* */ * */
#ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT #ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 # ifdef CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
# define LV_USE_GPU_NXP_PXP_AUTO_INIT CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
# else
# define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
# endif
#endif #endif
/*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */ /*1: Use VG-Lite for CPU offload on NXP RTxxx platforms */
#ifndef LV_USE_GPU_NXP_VG_LITE #ifndef LV_USE_GPU_NXP_VG_LITE
#define LV_USE_GPU_NXP_VG_LITE 0 # ifdef CONFIG_LV_USE_GPU_NXP_VG_LITE
# define LV_USE_GPU_NXP_VG_LITE CONFIG_LV_USE_GPU_NXP_VG_LITE
# else
# define LV_USE_GPU_NXP_VG_LITE 0
# endif
#endif #endif
/* 1: Enable file system (might be required for images */ /* 1: Enable file system (might be required for images */
@@ -621,7 +633,11 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
/* Required alignment size for buffers */ /* Required alignment size for buffers */
#ifndef LV_ATTRIBUTE_MEM_ALIGN_SIZE #ifndef LV_ATTRIBUTE_MEM_ALIGN_SIZE
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE # ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE
# define LV_ATTRIBUTE_MEM_ALIGN_SIZE CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE
# else
# define LV_ATTRIBUTE_MEM_ALIGN_SIZE
# endif
#endif #endif
/* With size optimization (-Os) the compiler might not align data to /* With size optimization (-Os) the compiler might not align data to
@@ -1874,7 +1890,15 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
# define LV_TABLE_COL_MAX 12 # define LV_TABLE_COL_MAX 12
# endif # endif
#endif #endif
#ifndef LV_TABLE_CELL_STYLE_CNT
# ifdef CONFIG_LV_TABLE_CELL_STYLE_CNT
# define LV_TABLE_CELL_STYLE_CNT CONFIG_LV_TABLE_CELL_STYLE_CNT
# else
# define LV_TABLE_CELL_STYLE_CNT 4
# endif
#endif #endif
#endif
/*Tab (dependencies: lv_page, lv_btnm)*/ /*Tab (dependencies: lv_page, lv_btnm)*/
#ifndef LV_USE_TABVIEW #ifndef LV_USE_TABVIEW
+1 -1
View File
@@ -757,7 +757,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
if(opa > LV_OPA_MAX) { if(opa > LV_OPA_MAX) {
#if LV_USE_GPU_NXP_PXP #if LV_USE_GPU_NXP_PXP
if (lv_area_get_size(draw_area) >= GPU_NXP_PXP_BLIT_SIZE_LIMIT) { if(lv_area_get_size(draw_area) >= GPU_NXP_PXP_BLIT_SIZE_LIMIT) {
lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa); lv_gpu_nxp_pxp_blit(disp_buf_first, disp_w, map_buf_first, map_w, draw_area_w, draw_area_h, opa);
return; return;
} }
+1 -1
View File
@@ -14,7 +14,7 @@
#include "../lv_misc/lv_mem.h" #include "../lv_misc/lv_mem.h"
#include "../lv_misc/lv_math.h" #include "../lv_misc/lv_math.h"
#if LV_USE_GPU_STM32_DMA2D #if LV_USE_GPU_STM32_DMA2D
#include "../lv_gpu/lv_gpu_stm32_dma2d.h" #include "../lv_gpu/lv_gpu_stm32_dma2d.h"
#elif LV_USE_GPU_NXP_PXP #elif LV_USE_GPU_NXP_PXP
#include "../lv_gpu/lv_gpu_nxp_pxp.h" #include "../lv_gpu/lv_gpu_nxp_pxp.h"
#endif #endif
+4 -2
View File
@@ -410,7 +410,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout)); area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout));
if(dsc->border_side == LV_BORDER_SIDE_FULL) { if(dsc->border_side == LV_BORDER_SIDE_FULL) {
draw_full_border(&area_inner, coords, clip, dsc->radius, false, dsc->border_color, dsc->border_opa, dsc->border_blend_mode); draw_full_border(&area_inner, coords, clip, dsc->radius, false, dsc->border_color, dsc->border_opa,
dsc->border_blend_mode);
} }
else { else {
lv_opa_t opa = dsc->border_opa; lv_opa_t opa = dsc->border_opa;
@@ -1347,7 +1348,8 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are
/*Get the outer area*/ /*Get the outer area*/
rout = rin + border_width; rout = rin + border_width;
} else { }
else {
rout = radius; rout = radius;
int32_t short_side = LV_MATH_MIN(coords_out_w, coords_out_h); int32_t short_side = LV_MATH_MIN(coords_out_w, coords_out_h);
if(rout > short_side >> 1) rout = short_side >> 1; if(rout > short_side >> 1) rout = short_side >> 1;
+6 -11
View File
@@ -7,7 +7,7 @@
******************************************************************************/ ******************************************************************************/
#ifndef LV_FONT_MONTSERRAT_10 #ifndef LV_FONT_MONTSERRAT_10
#define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_10 1
#endif #endif
#if LV_FONT_MONTSERRAT_10 #if LV_FONT_MONTSERRAT_10
@@ -1126,8 +1126,7 @@ static const uint16_t unicode_list_1[] = {
}; };
/*Collect the unicode lists and glyph_id offsets*/ /*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] = static const lv_font_fmt_txt_cmap_t cmaps[] = {
{
{ {
.range_start = 32, .range_length = 95, .glyph_id_start = 1, .range_start = 32, .range_length = 95, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
@@ -1144,8 +1143,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
/*Map glyph_ids to kern left classes*/ /*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] = static const uint8_t kern_left_class_mapping[] = {
{
0, 0, 1, 2, 0, 3, 4, 5, 0, 0, 1, 2, 0, 3, 4, 5,
2, 6, 7, 8, 9, 10, 9, 10, 2, 6, 7, 8, 9, 10, 9, 10,
11, 12, 0, 13, 14, 15, 16, 17, 11, 12, 0, 13, 14, 15, 16, 17,
@@ -1169,8 +1167,7 @@ static const uint8_t kern_left_class_mapping[] =
}; };
/*Map glyph_ids to kern right classes*/ /*Map glyph_ids to kern right classes*/
static const uint8_t kern_right_class_mapping[] = static const uint8_t kern_right_class_mapping[] = {
{
0, 0, 1, 2, 0, 3, 4, 5, 0, 0, 1, 2, 0, 3, 4, 5,
2, 6, 7, 8, 9, 10, 9, 10, 2, 6, 7, 8, 9, 10, 9, 10,
11, 12, 13, 14, 15, 16, 17, 12, 11, 12, 13, 14, 15, 16, 17, 12,
@@ -1194,8 +1191,7 @@ static const uint8_t kern_right_class_mapping[] =
}; };
/*Kern values between classes*/ /*Kern values between classes*/
static const int8_t kern_class_values[] = static const int8_t kern_class_values[] = {
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
@@ -1574,8 +1570,7 @@ static const int8_t kern_class_values[] =
/*Collect the kern class' data in one place*/ /*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes = static const lv_font_fmt_txt_kern_classes_t kern_classes = {
{
.class_pair_values = kern_class_values, .class_pair_values = kern_class_values,
.left_class_mapping = kern_left_class_mapping, .left_class_mapping = kern_left_class_mapping,
.right_class_mapping = kern_right_class_mapping, .right_class_mapping = kern_right_class_mapping,
+6 -11
View File
@@ -7,7 +7,7 @@
******************************************************************************/ ******************************************************************************/
#ifndef LV_FONT_MONTSERRAT_8 #ifndef LV_FONT_MONTSERRAT_8
#define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_8 1
#endif #endif
#if LV_FONT_MONTSERRAT_8 #if LV_FONT_MONTSERRAT_8
@@ -918,8 +918,7 @@ static const uint16_t unicode_list_1[] = {
}; };
/*Collect the unicode lists and glyph_id offsets*/ /*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] = static const lv_font_fmt_txt_cmap_t cmaps[] = {
{
{ {
.range_start = 32, .range_length = 95, .glyph_id_start = 1, .range_start = 32, .range_length = 95, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
@@ -936,8 +935,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
/*Map glyph_ids to kern left classes*/ /*Map glyph_ids to kern left classes*/
static const uint8_t kern_left_class_mapping[] = static const uint8_t kern_left_class_mapping[] = {
{
0, 0, 1, 2, 0, 3, 4, 5, 0, 0, 1, 2, 0, 3, 4, 5,
2, 6, 7, 8, 9, 10, 9, 10, 2, 6, 7, 8, 9, 10, 9, 10,
11, 12, 0, 13, 14, 15, 16, 17, 11, 12, 0, 13, 14, 15, 16, 17,
@@ -961,8 +959,7 @@ static const uint8_t kern_left_class_mapping[] =
}; };
/*Map glyph_ids to kern right classes*/ /*Map glyph_ids to kern right classes*/
static const uint8_t kern_right_class_mapping[] = static const uint8_t kern_right_class_mapping[] = {
{
0, 0, 1, 2, 0, 3, 4, 5, 0, 0, 1, 2, 0, 3, 4, 5,
2, 6, 7, 8, 9, 10, 9, 10, 2, 6, 7, 8, 9, 10, 9, 10,
11, 12, 13, 14, 15, 16, 17, 12, 11, 12, 13, 14, 15, 16, 17, 12,
@@ -986,8 +983,7 @@ static const uint8_t kern_right_class_mapping[] =
}; };
/*Kern values between classes*/ /*Kern values between classes*/
static const int8_t kern_class_values[] = static const int8_t kern_class_values[] = {
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
@@ -1366,8 +1362,7 @@ static const int8_t kern_class_values[] =
/*Collect the kern class' data in one place*/ /*Collect the kern class' data in one place*/
static const lv_font_fmt_txt_kern_classes_t kern_classes = static const lv_font_fmt_txt_kern_classes_t kern_classes = {
{
.class_pair_values = kern_class_values, .class_pair_values = kern_class_values,
.left_class_mapping = kern_left_class_mapping, .left_class_mapping = kern_left_class_mapping,
.right_class_mapping = kern_right_class_mapping, .right_class_mapping = kern_right_class_mapping,
+1 -1
View File
@@ -194,7 +194,7 @@ lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit)
return LV_RES_OK; /* Nothing to BLIT */ return LV_RES_OK; /* Nothing to BLIT */
} }
if (!blit) { if(!blit) {
/* Wrong parameter */ /* Wrong parameter */
return LV_RES_INV; return LV_RES_INV;
} }
+2 -3
View File
@@ -1264,8 +1264,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
break; break;
#endif #endif
#if LV_USE_TABLE #if LV_USE_TABLE
case LV_THEME_TABLE: case LV_THEME_TABLE: {
{
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG); list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg); _lv_style_list_add_style(list, &styles->bg);
@@ -1273,7 +1272,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
start at 1 due to presence of LV_TABLE_PART_BG=0 start at 1 due to presence of LV_TABLE_PART_BG=0
in the enum (lv_table.h) */ in the enum (lv_table.h) */
/* declaring idx outside loop to work with older compilers */ /* declaring idx outside loop to work with older compilers */
for (;idx <= LV_TABLE_CELL_STYLE_CNT; idx ++ ) { for(; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++) {
list = lv_obj_get_style_list(obj, idx); list = lv_obj_get_style_list(obj, idx);
_lv_style_list_add_style(list, &styles->table_cell); _lv_style_list_add_style(list, &styles->table_cell);
} }
+2 -3
View File
@@ -888,8 +888,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
break; break;
#endif #endif
#if LV_USE_TABLE #if LV_USE_TABLE
case LV_THEME_TABLE: case LV_THEME_TABLE: {
{
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG); list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg); _lv_style_list_add_style(list, &styles->bg);
@@ -897,7 +896,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
start at 1 due to presence of LV_TABLE_PART_BG=0 start at 1 due to presence of LV_TABLE_PART_BG=0
in the enum (lv_table.h) */ in the enum (lv_table.h) */
/* declaring idx outside loop to work with older compilers */ /* declaring idx outside loop to work with older compilers */
for (; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++ ) { for(; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++) {
list = lv_obj_get_style_list(obj, idx); list = lv_obj_get_style_list(obj, idx);
_lv_style_list_add_style(list, &styles->bg); _lv_style_list_add_style(list, &styles->bg);
_lv_style_list_add_style(list, &styles->no_radius); _lv_style_list_add_style(list, &styles->no_radius);
+2 -3
View File
@@ -727,8 +727,7 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
break; break;
#endif #endif
#if LV_USE_TABLE #if LV_USE_TABLE
case LV_THEME_TABLE: case LV_THEME_TABLE: {
{
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG); list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
_lv_style_list_add_style(list, &styles->bg); _lv_style_list_add_style(list, &styles->bg);
@@ -736,7 +735,7 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
start at 1 due to presence of LV_TABLE_PART_BG=0 start at 1 due to presence of LV_TABLE_PART_BG=0
in the enum (lv_table.h) */ in the enum (lv_table.h) */
/* declaring idx outside loop to work with older compilers */ /* declaring idx outside loop to work with older compilers */
for (; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++ ) { for(; idx <= LV_TABLE_CELL_STYLE_CNT; idx ++) {
list = lv_obj_get_style_list(obj, idx); list = lv_obj_get_style_list(obj, idx);
_lv_style_list_add_style(list, &styles->bg); _lv_style_list_add_style(list, &styles->bg);
} }
+5 -2
View File
@@ -806,7 +806,8 @@ lv_coord_t lv_chart_get_x_from_index(lv_obj_t * chart, lv_chart_series_t * ser,
if(ext->type & LV_CHART_TYPE_LINE) { if(ext->type & LV_CHART_TYPE_LINE) {
x = (w * id) / (ext->point_cnt - 1); x = (w * id) / (ext->point_cnt - 1);
} else if(ext->type & LV_CHART_TYPE_COLUMN) { }
else if(ext->type & LV_CHART_TYPE_COLUMN) {
lv_coord_t col_w = w / ((_lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/ lv_coord_t col_w = w / ((_lv_ll_get_len(&ext->series_ll) + 1) * ext->point_cnt); /* Suppose + 1 series as separator*/
lv_chart_series_t * itr_ser = NULL; lv_chart_series_t * itr_ser = NULL;
lv_style_int_t col_space = lv_obj_get_style_pad_inner(chart, LV_CHART_PART_SERIES); lv_style_int_t col_space = lv_obj_get_style_pad_inner(chart, LV_CHART_PART_SERIES);
@@ -1620,7 +1621,9 @@ static void draw_y_ticks(lv_obj_t * chart, const lv_area_t * series_area, const
/* set the area at some distance of the major tick len left of the tick */ /* set the area at some distance of the major tick len left of the tick */
/* changed to explicit member initialization to allow compilation as c++ */ /* changed to explicit member initialization to allow compilation as c++ */
lv_area_t a; a.y1 = p2.y - size.y / 2; a.y2 = p2.y + size.y / 2; lv_area_t a;
a.y1 = p2.y - size.y / 2;
a.y2 = p2.y + size.y / 2;
if(which_axis == LV_CHART_AXIS_PRIMARY_Y) { if(which_axis == LV_CHART_AXIS_PRIMARY_Y) {
a.x1 = p2.x - size.x - label_dist; a.x1 = p2.x - size.x - label_dist;
+2 -1
View File
@@ -571,7 +571,8 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
if(lv_obj_get_base_dir(cont) == LV_BIDI_DIR_RTL) { if(lv_obj_get_base_dir(cont) == LV_BIDI_DIR_RTL) {
align = LV_ALIGN_IN_TOP_RIGHT; align = LV_ALIGN_IN_TOP_RIGHT;
inv = -1; inv = -1;
} else { }
else {
align = LV_ALIGN_IN_TOP_LEFT; align = LV_ALIGN_IN_TOP_LEFT;
inv = 1; inv = 1;
} }
+6 -4
View File
@@ -878,7 +878,8 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_
if(rtl) { if(rtl) {
cell_area.x2 = cell_area.x1 - 1; cell_area.x2 = cell_area.x1 - 1;
cell_area.x1 = cell_area.x2 - ext->col_w[col] + 1; cell_area.x1 = cell_area.x2 - ext->col_w[col] + 1;
} else { }
else {
cell_area.x1 = cell_area.x2 + 1; cell_area.x1 = cell_area.x2 + 1;
cell_area.x2 = cell_area.x1 + ext->col_w[col] - 1; cell_area.x2 = cell_area.x1 + ext->col_w[col] - 1;
} }
@@ -1066,10 +1067,11 @@ static lv_style_list_t * lv_table_get_style(lv_obj_t * table, uint8_t part)
/* Because of the presence of LV_TABLE_PART_BG, LV_TABLE_PART_CELL<i> has an integer value /* Because of the presence of LV_TABLE_PART_BG, LV_TABLE_PART_CELL<i> has an integer value
of <i>. This comes in useful to extend above code with more cell types as follows */ of <i>. This comes in useful to extend above code with more cell types as follows */
if ( part == LV_TABLE_PART_BG ) { if(part == LV_TABLE_PART_BG) {
return &table->style_list; return &table->style_list;
} else if (part >= 1 && part <= LV_TABLE_CELL_STYLE_CNT ) { }
return &ext->cell_style[part-1]; else if(part >= 1 && part <= LV_TABLE_CELL_STYLE_CNT) {
return &ext->cell_style[part - 1];
} }
return NULL; return NULL;
+2 -1
View File
@@ -71,7 +71,8 @@ typedef struct {
lv_coord_t * row_h; lv_coord_t * row_h;
lv_style_list_t cell_style[LV_TABLE_CELL_STYLE_CNT]; lv_style_list_t cell_style[LV_TABLE_CELL_STYLE_CNT];
lv_coord_t col_w[LV_TABLE_COL_MAX]; lv_coord_t col_w[LV_TABLE_COL_MAX];
uint16_t cell_types : LV_TABLE_CELL_STYLE_CNT; /*Keep track which cell types exists to avoid dealing with unused ones*/ uint16_t cell_types :
LV_TABLE_CELL_STYLE_CNT; /*Keep track which cell types exists to avoid dealing with unused ones*/
} lv_table_ext_t; } lv_table_ext_t;
/*Parts of the table*/ /*Parts of the table*/