mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-23 15:56:59 +08:00
fixes in various configurations
This commit is contained in:
+3
-4
@@ -335,7 +335,6 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
|
||||
/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
|
||||
typedef void * lv_font_user_data_t;
|
||||
|
||||
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
@@ -347,10 +346,10 @@ typedef void * lv_font_user_data_t;
|
||||
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
|
||||
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
|
||||
#define LV_THEME_DEFAULT_FLAGS LV_THEME_MATERIAL_FLAG_NONE
|
||||
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_roboto_12
|
||||
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_roboto_16
|
||||
#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_roboto_16
|
||||
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_roboto_22
|
||||
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_roboto_28
|
||||
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_roboto_16
|
||||
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_roboto_16
|
||||
|
||||
/*=================
|
||||
* Text settings
|
||||
|
||||
@@ -66,7 +66,7 @@ extern "C" {
|
||||
#include "src/lv_widgets/lv_linemeter.h"
|
||||
#include "src/lv_widgets/lv_switch.h"
|
||||
#include "src/lv_widgets/lv_arc.h"
|
||||
#include "src/lv_widgets/lv_preload.h"
|
||||
#include "src/lv_widgets/lv_spinner.h"
|
||||
#include "src/lv_widgets/lv_calendar.h"
|
||||
#include "src/lv_widgets/lv_spinbox.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core/lv_core.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_hal/lv_hal.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_objx/lv_objx.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets/lv_widgets.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font/lv_font.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes/lv_themes.mk
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -469,11 +469,6 @@
|
||||
#define LV_FONT_CUSTOM_DECLARE
|
||||
#endif
|
||||
|
||||
/*Always set a default font from the built-in fonts*/
|
||||
#ifndef LV_FONT_DEFAULT
|
||||
#define LV_FONT_DEFAULT &lv_font_roboto_16
|
||||
#endif
|
||||
|
||||
/* Enable it if you have fonts with a lot of characters.
|
||||
* The limit depends on the font size, font face and bpp
|
||||
* but with > 10,000 characters if you see issues probably you need to enable it.*/
|
||||
|
||||
@@ -164,9 +164,11 @@ do { \
|
||||
|
||||
#define LV_ASSERT_NULL(p) true
|
||||
#define LV_ASSERT_MEM(p) true
|
||||
#define LV_ASSERT_MEM_INTEGRITY() true
|
||||
#define LV_ASSERT_STR(p) true
|
||||
#define LV_ASSERT_OBJ(obj, obj_type) true
|
||||
#define LV_ASSERT_STYLE(p) true
|
||||
#define LV_ASSERT_STYLE_LIST(p) true
|
||||
|
||||
#endif /* LV_USE_DEBUG */
|
||||
/*clang-format on*/
|
||||
|
||||
+14
-4
@@ -57,7 +57,9 @@ static void report_style_mod_core(void * style_p, lv_obj_t * obj);
|
||||
static void refresh_children_style(lv_obj_t * obj);
|
||||
static void delete_children(lv_obj_t * obj);
|
||||
static void base_dir_refr_children(lv_obj_t * obj);
|
||||
#if LV_USE_ANIMATION
|
||||
static void obj_state_anim_cb(void * p, lv_anim_value_t value);
|
||||
#endif
|
||||
static void lv_event_mark_deleted(lv_obj_t * obj);
|
||||
static void lv_obj_del_async_cb(void * obj);
|
||||
static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
@@ -1415,17 +1417,23 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
lv_obj_state_dsc_t dsc_ori = obj->state_dsc;
|
||||
obj->state_dsc.act = new_state;
|
||||
obj->state_dsc.prev = new_state;
|
||||
#if LV_USE_ANIMATION
|
||||
lv_style_int_t t = lv_obj_get_style_transition_time(obj, LV_OBJ_PART_MAIN);
|
||||
#else
|
||||
lv_style_int_t t = 0;
|
||||
#endif
|
||||
obj->state_dsc = dsc_ori;
|
||||
if(t == 0) {
|
||||
#if LV_USE_ANIMATION
|
||||
lv_anim_del(obj, obj_state_anim_cb);
|
||||
#endif
|
||||
obj->state_dsc.act = new_state;
|
||||
obj->state_dsc.prev = new_state;
|
||||
obj->state_dsc.anim = 0;
|
||||
lv_obj_refresh_style(obj);
|
||||
}
|
||||
else {
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
bool was_anim = lv_anim_del(obj, obj_state_anim_cb);
|
||||
|
||||
if(obj->state_dsc.anim == 0 && was_anim) {
|
||||
@@ -1442,7 +1450,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
lv_anim_set_values(&a, 0, 255);
|
||||
lv_anim_set_time(&a, t, 0);
|
||||
lv_anim_create(&a);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2193,6 +2201,7 @@ lv_color_t _lv_obj_get_style_color(const lv_obj_t * obj, uint8_t part, lv_style_
|
||||
prop = (uint16_t)prop_ori + ((uint16_t)state->prev << LV_STYLE_STATE_POS);
|
||||
res = lv_style_list_get_color(dsc, prop, &value_prev);
|
||||
if(res == LV_RES_INV) value_prev = value_act;
|
||||
if(value_act.full == value_prev.full) return value_act;
|
||||
return lv_color_mix(value_act, value_prev, state->anim);
|
||||
}
|
||||
}
|
||||
@@ -2350,7 +2359,7 @@ const void * _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_
|
||||
switch(prop) {
|
||||
case LV_STYLE_TEXT_FONT:
|
||||
case LV_STYLE_VALUE_FONT:
|
||||
return LV_FONT_DEFAULT;
|
||||
return LV_THEME_DEFAULT_FONT_NORMAL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -3336,6 +3345,7 @@ static void base_dir_refr_children(lv_obj_t * obj)
|
||||
}
|
||||
}
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
static void obj_state_anim_cb(void * p, lv_anim_value_t value)
|
||||
{
|
||||
lv_obj_t * obj = p;
|
||||
@@ -3344,7 +3354,7 @@ static void obj_state_anim_cb(void * p, lv_anim_value_t value)
|
||||
|
||||
lv_obj_refresh_style(obj);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void lv_event_mark_deleted(lv_obj_t * obj)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ void lv_style_list_init(lv_style_list_t * list)
|
||||
list->style_list = NULL;
|
||||
list->style_cnt = 0;
|
||||
list->has_local = 0;
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
list->sentinel = LV_DEBUG_STYLE_LIST_SENTINEL_VALUE;
|
||||
#endif
|
||||
}
|
||||
@@ -124,7 +124,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis
|
||||
list_dest->style_cnt = list_src->style_cnt - 1;
|
||||
|
||||
lv_style_t * local_style = get_local_style(list_dest);
|
||||
lv_style_copy(local_style, get_local_style((lv_style_t *)list_src));
|
||||
lv_style_copy(local_style, get_local_style((lv_style_list_t *)list_src));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
memset(dsc, 0x00, sizeof(lv_draw_label_dsc_t));
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
dsc->color = LV_COLOR_BLACK;
|
||||
dsc->font = LV_FONT_DEFAULT;
|
||||
dsc->font = LV_THEME_DEFAULT_FONT_NORMAL;
|
||||
dsc->sel_start = LV_DRAW_LABEL_NO_TXT_SEL;
|
||||
dsc->sel_end = LV_DRAW_LABEL_NO_TXT_SEL;
|
||||
dsc->sel_color = LV_COLOR_BLUE;
|
||||
@@ -669,7 +669,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
||||
vdb_buf_tmp->ch.blue};
|
||||
#endif
|
||||
|
||||
#if LV_SUBPX_BGR
|
||||
#if LV_FONT_SUBPX_BGR
|
||||
res_color.ch.blue = (uint326_t)((uint32_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8;
|
||||
res_color.ch.red = (uint32_t)((uint32_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8;
|
||||
#else
|
||||
|
||||
@@ -63,9 +63,9 @@ void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
|
||||
dsc->outline_opa = LV_OPA_COVER;
|
||||
dsc->border_opa = LV_OPA_COVER;
|
||||
dsc->pattern_opa = LV_OPA_COVER;
|
||||
dsc->pattern_font = LV_FONT_DEFAULT;
|
||||
dsc->pattern_font = LV_THEME_DEFAULT_FONT_NORMAL;
|
||||
dsc->value_opa = LV_OPA_COVER;
|
||||
dsc->value_font = LV_FONT_DEFAULT;
|
||||
dsc->value_font = LV_THEME_DEFAULT_FONT_NORMAL;
|
||||
dsc->shadow_opa = LV_OPA_COVER;
|
||||
dsc->border_side = LV_BORDER_SIDE_FULL;
|
||||
|
||||
@@ -1314,6 +1314,7 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr
|
||||
/*Trigger the error handler of image drawer*/
|
||||
LV_LOG_WARN("lv_img_design: image source type is unknown");
|
||||
lv_draw_img(coords, clip, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t coords_tmp;
|
||||
|
||||
@@ -49,14 +49,16 @@ static lv_font_t * _font_title;
|
||||
static lv_style_t scr;
|
||||
static lv_style_t panel; /*General fancy background (e.g. to chart or ta)*/
|
||||
static lv_style_t btn;
|
||||
static lv_style_t sb;
|
||||
|
||||
#if LV_USE_PAGE
|
||||
static lv_style_t sb;
|
||||
#endif
|
||||
|
||||
#if LV_USE_BTNMATRIX
|
||||
static lv_style_t btnm_bg, btnm_btn;
|
||||
#endif
|
||||
|
||||
#if LV_USE_BTNMATRIX
|
||||
#if LV_USE_KEYBOARD
|
||||
static lv_style_t kb_bg, kb_btn;
|
||||
#endif
|
||||
|
||||
@@ -166,7 +168,7 @@ static void basic_init(void)
|
||||
lv_style_set_pad_inner(&panel, LV_STATE_NORMAL, LV_DPI / 5);
|
||||
lv_style_set_text_color(&panel, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_value_color(&panel, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_text_font(&panel, LV_STATE_NORMAL, &lv_font_roboto_16);
|
||||
lv_style_set_text_font(&panel, LV_STATE_NORMAL, _font_normal);
|
||||
lv_style_set_image_recolor(&panel, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_line_color(&panel, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_line_width(&panel, LV_STATE_NORMAL, 1);
|
||||
@@ -719,7 +721,7 @@ static void tabview_init(void)
|
||||
lv_style_set_border_width(&tabview_btns_bg, LV_STATE_NORMAL, LV_DPI / 30 > 0 ? LV_DPI / 30 : 1);
|
||||
lv_style_set_border_side(&tabview_btns_bg, LV_STATE_NORMAL , LV_BORDER_SIDE_BOTTOM);
|
||||
lv_style_set_text_color(&tabview_btns_bg, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_text_font(&tabview_btns_bg, LV_STATE_NORMAL, &lv_font_roboto_16);
|
||||
lv_style_set_text_font(&tabview_btns_bg, LV_STATE_NORMAL, _font_normal);
|
||||
lv_style_set_image_recolor(&tabview_btns_bg, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
|
||||
|
||||
@@ -840,15 +842,6 @@ lv_theme_t * lv_theme_material_init(lv_color_t color_primary, lv_color_t color_s
|
||||
return &theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the theme
|
||||
* @return pointer to the theme
|
||||
*/
|
||||
lv_theme_t * lv_theme_alien_get(void)
|
||||
{
|
||||
return &theme;
|
||||
}
|
||||
|
||||
|
||||
void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
{
|
||||
@@ -1345,6 +1338,8 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
lv_style_list_add_style(list, &gauge_needle);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
CSRCS += lv_theme_alien.c
|
||||
CSRCS += lv_theme.c
|
||||
CSRCS += lv_theme_default.c
|
||||
CSRCS += lv_theme_night.c
|
||||
CSRCS += lv_theme_templ.c
|
||||
CSRCS += lv_theme_zen.c
|
||||
CSRCS += lv_theme_material.c
|
||||
CSRCS += lv_theme_nemo.c
|
||||
CSRCS += lv_theme_mono.c
|
||||
|
||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes
|
||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes
|
||||
|
||||
@@ -625,10 +625,10 @@ static lv_res_t lv_bar_signal(lv_obj_t * bar, lv_signal_t sign, void * param)
|
||||
bar->ext_draw_pad = LV_MATH_MAX(bar->ext_draw_pad, indic_size);
|
||||
|
||||
}
|
||||
|
||||
if(sign == LV_SIGNAL_CLEANUP) {
|
||||
lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
|
||||
lv_style_list_reset(&ext->style_indic);
|
||||
#if LV_USE_ANIMATION
|
||||
lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
|
||||
lv_anim_del(&ext->cur_value_anim, NULL);
|
||||
lv_anim_del(&ext->start_value_anim, NULL);
|
||||
#endif
|
||||
|
||||
@@ -806,10 +806,13 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
|
||||
ext->btn_id_act = btn_pr;
|
||||
invalidate_button_area(btnm, ext->btn_id_pr); /*Invalidate the new area*/
|
||||
}
|
||||
} else if(indev_type == LV_INDEV_TYPE_KEYPAD || (indev_type == LV_INDEV_TYPE_ENCODER && lv_group_get_editing(lv_obj_get_group(btnm)))) {
|
||||
}
|
||||
#if LV_USE_GROUP
|
||||
else if(indev_type == LV_INDEV_TYPE_KEYPAD || (indev_type == LV_INDEV_TYPE_ENCODER && lv_group_get_editing(lv_obj_get_group(btnm)))) {
|
||||
ext->btn_id_pr = ext->btn_id_focused;
|
||||
invalidate_button_area(btnm, ext->btn_id_focused);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(ext->btn_id_act != LV_BTNMATRIX_BTN_NONE) {
|
||||
if(button_is_click_trig(ext->ctrl_bits[ext->btn_id_act]) == false &&
|
||||
|
||||
@@ -426,7 +426,10 @@ static lv_res_t lv_calendar_signal(lv_obj_t * calendar, lv_signal_t sign, void *
|
||||
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
|
||||
|
||||
if(sign == LV_SIGNAL_CLEANUP) {
|
||||
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
|
||||
lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);
|
||||
lv_style_list_reset(&ext->style_header);
|
||||
lv_style_list_reset(&ext->style_day_names);
|
||||
lv_style_list_reset(&ext->style_date_nums);
|
||||
} else if(sign == LV_SIGNAL_PRESSING) {
|
||||
lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);
|
||||
lv_area_t header_area;
|
||||
|
||||
@@ -821,6 +821,7 @@ static void draw_series_line(lv_obj_t * chart, const lv_area_t * series_area, co
|
||||
p1.x = 0 + x_ofs;
|
||||
p2.x = 0 + x_ofs;
|
||||
|
||||
p_act = start_point;
|
||||
p_prev = start_point;
|
||||
y_tmp = (int32_t)((int32_t)ser->points[p_prev] - ext->ymin) * h;
|
||||
y_tmp = y_tmp / (ext->ymax - ext->ymin);
|
||||
|
||||
@@ -56,8 +56,10 @@ static void page_press_handler(lv_obj_t * page);
|
||||
static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t x, lv_coord_t y);
|
||||
static void pos_selected(lv_obj_t * ddlist);
|
||||
static lv_obj_t * get_label(const lv_obj_t * ddlist);
|
||||
#if LV_USE_ANIMATION
|
||||
static void list_anim(void * p, lv_anim_value_t v);
|
||||
static void close_anim_ready(lv_anim_t * a);
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -503,6 +505,7 @@ void lv_dropdown_open(lv_obj_t * ddlist, lv_anim_enable_t anim)
|
||||
}
|
||||
}
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
if(ext->dir != LV_DROPDOWN_DIR_UP) {
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
@@ -511,6 +514,7 @@ void lv_dropdown_open(lv_obj_t * ddlist, lv_anim_enable_t anim)
|
||||
lv_anim_set_time(&a, ext->anim_time, 0);
|
||||
lv_anim_create(&a);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -532,16 +536,18 @@ void lv_dropdown_close(lv_obj_t * ddlist, lv_anim_enable_t anim)
|
||||
lv_obj_del(ext->page);
|
||||
ext->page = NULL;
|
||||
} else {
|
||||
// if(dir != LV_DROPDOWN_DIR_UP) {
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_exec_cb(&a, ddlist, list_anim);
|
||||
lv_anim_set_values(&a, lv_obj_get_height(ext->page), 0);
|
||||
lv_anim_set_time(&a, ext->anim_time, 0);
|
||||
lv_anim_set_ready_cb(&a, close_anim_ready);
|
||||
lv_anim_create(&a);
|
||||
#if LV_USE_ANIMATION
|
||||
if(ext->dir != LV_DROPDOWN_DIR_UP) {
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_exec_cb(&a, ddlist, list_anim);
|
||||
lv_anim_set_values(&a, lv_obj_get_height(ext->page), 0);
|
||||
lv_anim_set_time(&a, ext->anim_time, 0);
|
||||
lv_anim_set_ready_cb(&a, close_anim_ready);
|
||||
lv_anim_create(&a);
|
||||
|
||||
// }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -628,7 +634,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c
|
||||
lv_draw_label(&txt_area, clip_area, &label_dsc, txt, NULL);
|
||||
}
|
||||
|
||||
if(ext->show_selected && ext->sel_opt_id_orig >= 0) {
|
||||
if(ext->show_selected) {
|
||||
lv_mem_buf_release((char *)opt_txt);
|
||||
}
|
||||
|
||||
@@ -1119,6 +1125,7 @@ static lv_obj_t * get_label(const lv_obj_t * ddlist)
|
||||
return lv_obj_get_child(lv_page_get_scrl(ext->page), NULL);
|
||||
}
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
static void list_anim(void * p, lv_anim_value_t v)
|
||||
{
|
||||
lv_obj_t * ddlist = p;
|
||||
@@ -1133,5 +1140,6 @@ static void close_anim_ready(lv_anim_t * a)
|
||||
lv_obj_del(ext->page);
|
||||
ext->page = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -86,8 +86,8 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
|
||||
#if LV_USE_GROUP
|
||||
ext->last_sel_btn = NULL;
|
||||
ext->act_sel_btn = NULL;
|
||||
#endif
|
||||
ext->act_sel_btn = NULL;
|
||||
|
||||
lv_obj_set_signal_cb(list, lv_list_signal);
|
||||
|
||||
@@ -255,8 +255,6 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index)
|
||||
* Setter functions
|
||||
*====================*/
|
||||
|
||||
#if LV_USE_GROUP
|
||||
|
||||
/**
|
||||
* Make a button selected
|
||||
* @param list pointer to a list object
|
||||
@@ -273,10 +271,11 @@ void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn)
|
||||
/*Defocus the current button*/
|
||||
if(ext->act_sel_btn) lv_obj_clear_state(ext->act_sel_btn, LV_STATE_FOCUSED);
|
||||
|
||||
|
||||
#if LV_USE_GROUP
|
||||
/*Don't forget which button was selected.
|
||||
* It will be restored when the list is focused again.*/
|
||||
if(btn) ext->last_sel_btn = btn;
|
||||
#endif
|
||||
|
||||
/*Focus the new button*/
|
||||
ext->act_sel_btn = btn;
|
||||
@@ -287,8 +286,6 @@ void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set layout of a list
|
||||
* @param list pointer to a list object
|
||||
|
||||
@@ -51,8 +51,8 @@ typedef struct
|
||||
|
||||
#if LV_USE_GROUP
|
||||
lv_obj_t * last_sel_btn; /* The last selected button. It will be reverted when the list is focused again */
|
||||
lv_obj_t * act_sel_btn; /* The button is currently being selected*/
|
||||
#endif
|
||||
lv_obj_t * act_sel_btn; /* The button is currently being selected*/
|
||||
} lv_list_ext_t;
|
||||
|
||||
/** List styles. */
|
||||
@@ -110,8 +110,6 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index);
|
||||
* Setter functions
|
||||
*====================*/
|
||||
|
||||
#if LV_USE_GROUP
|
||||
|
||||
/**
|
||||
* Make a button selected
|
||||
* @param list pointer to a list object
|
||||
@@ -119,7 +117,6 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index);
|
||||
* NULL to not select any buttons
|
||||
*/
|
||||
void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the scroll bar mode of a list
|
||||
|
||||
@@ -766,7 +766,9 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
|
||||
}
|
||||
|
||||
lv_style_list_reset(&ext->sb.style);
|
||||
#if LV_USE_ANIMATION
|
||||
lv_style_list_reset(&ext->edge_flash.style);
|
||||
#endif
|
||||
}
|
||||
/*Automatically move children to the scrollable object*/
|
||||
else if(sign == LV_SIGNAL_CHILD_CHG) {
|
||||
|
||||
@@ -375,6 +375,8 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
||||
res = lv_event_send(slider, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
if(res != LV_RES_OK) return res;
|
||||
}
|
||||
} else if(sign == LV_SIGNAL_CLEANUP) {
|
||||
lv_style_list_reset(&ext->style_knob);
|
||||
} else if(sign == LV_SIGNAL_GET_EDITABLE) {
|
||||
bool * editable = (bool *)param;
|
||||
*editable = true;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_preload.h"
|
||||
#include "lv_spinner.h"
|
||||
#if LV_USE_SPINNER != 0
|
||||
|
||||
#include "../lv_core/lv_debug.h"
|
||||
@@ -1,12 +1,12 @@
|
||||
CSRCS += lv_arc.c
|
||||
CSRCS += lv_bar.c
|
||||
CSRCS += lv_cb.c
|
||||
CSRCS += lv_checkbox.c
|
||||
CSRCS += lv_cpicker.c
|
||||
CSRCS += lv_ddlist.c
|
||||
CSRCS += lv_kb.c
|
||||
CSRCS += lv_dropdown.c
|
||||
CSRCS += lv_keyboard.c
|
||||
CSRCS += lv_line.c
|
||||
CSRCS += lv_mbox.c
|
||||
CSRCS += lv_preload.c
|
||||
CSRCS += lv_msgbox.c
|
||||
CSRCS += lv_spinner.c
|
||||
CSRCS += lv_roller.c
|
||||
CSRCS += lv_table.c
|
||||
CSRCS += lv_tabview.c
|
||||
@@ -19,20 +19,20 @@ CSRCS += lv_gauge.c
|
||||
CSRCS += lv_label.c
|
||||
CSRCS += lv_list.c
|
||||
CSRCS += lv_slider.c
|
||||
CSRCS += lv_ta.c
|
||||
CSRCS += lv_textarea.c
|
||||
CSRCS += lv_spinbox.c
|
||||
CSRCS += lv_btnm.c
|
||||
CSRCS += lv_btnmatrix.c
|
||||
CSRCS += lv_cont.c
|
||||
CSRCS += lv_img.c
|
||||
CSRCS += lv_imgbtn.c
|
||||
CSRCS += lv_led.c
|
||||
CSRCS += lv_lmeter.c
|
||||
CSRCS += lv_linemeter.c
|
||||
CSRCS += lv_page.c
|
||||
CSRCS += lv_sw.c
|
||||
CSRCS += lv_switch.c
|
||||
CSRCS += lv_win.c
|
||||
CSRCS += lv_objmask.c
|
||||
|
||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_objx
|
||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_objx
|
||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets
|
||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets
|
||||
|
||||
CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_objx"
|
||||
CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets"
|
||||
@@ -124,7 +124,6 @@ void lv_win_set_title(lv_obj_t * win, const char * title);
|
||||
*/
|
||||
void lv_win_set_header_height(lv_obj_t * win, lv_coord_t size);
|
||||
|
||||
|
||||
/**
|
||||
* Set the size of the content area.
|
||||
* @param win pointer to a window object
|
||||
@@ -186,6 +185,13 @@ lv_obj_t * lv_win_get_content(const lv_obj_t * win);
|
||||
*/
|
||||
lv_coord_t lv_win_get_btn_size(const lv_obj_t * win);
|
||||
|
||||
/**
|
||||
* Get the header height
|
||||
* @param win pointer to a window object
|
||||
* @return header height
|
||||
*/
|
||||
lv_coord_t lv_win_get_header_height(const lv_obj_t * win);
|
||||
|
||||
/**
|
||||
* Get the pointer of a widow from one of its control button.
|
||||
* It is useful in the action of the control buttons where only button is known.
|
||||
|
||||
@@ -21,6 +21,9 @@ MAINSRC = ./lv_test_main.c
|
||||
include ../lvgl.mk
|
||||
|
||||
CSRCS += lv_test_assert.c
|
||||
CSRCS += lv_test_core/lv_test_core.c
|
||||
CSRCS += lv_test_core/lv_test_obj.c
|
||||
CSRCS += lv_test_core/lv_test_style.c
|
||||
|
||||
OBJEXT ?= .o
|
||||
|
||||
|
||||
+63
-50
@@ -63,8 +63,16 @@ minimal_monochrome = {
|
||||
"LV_USE_FILESYSTEM":0,
|
||||
"LV_USE_USER_DATA":0,
|
||||
"LV_USE_LOG":0,
|
||||
"LV_USE_THEME_MATERIAL":1,
|
||||
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"",
|
||||
"LV_THEME_DEFAULT_FLAGS" : "\\\"LV_THEME_MATERIAL_FLAG_NONE\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_unscii_8\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_unscii_8\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_unscii_8\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_unscii_8\\\"",
|
||||
"LV_USE_DEBUG":0,
|
||||
"LV_THEME_LIVE_UPDATE":0,
|
||||
"LV_FONT_ROBOTO_12":0,
|
||||
"LV_FONT_ROBOTO_16":0,
|
||||
"LV_FONT_ROBOTO_22":0,
|
||||
@@ -72,7 +80,6 @@ minimal_monochrome = {
|
||||
"LV_FONT_ROBOTO_12_SUBPX":0,
|
||||
"LV_FONT_ROBOTO_28_COMPRESSED":0,
|
||||
"LV_FONT_UNSCII_8":1,
|
||||
"LV_FONT_DEFAULT":"\\\"&lv_font_unscii_8\\\"",
|
||||
"LV_USE_BIDI": 0,
|
||||
"LV_USE_OBJ_REALIGN": 0,
|
||||
"LV_USE_ARC":0,
|
||||
@@ -81,29 +88,29 @@ minimal_monochrome = {
|
||||
"LV_USE_BTNM":0,
|
||||
"LV_USE_CALENDAR":0,
|
||||
"LV_USE_CANVAS":0,
|
||||
"LV_USE_CB":0,
|
||||
"LV_USE_CHECKBOX":0,
|
||||
"LV_USE_CHART":0,
|
||||
"LV_USE_CONT":1,
|
||||
"LV_USE_CPICKER":0,
|
||||
"LV_USE_DDLIST":0,
|
||||
"LV_USE_DROPDOWN":0,
|
||||
"LV_USE_GAUGE":0,
|
||||
"LV_USE_IMG":1,
|
||||
"LV_USE_IMGBTN":0,
|
||||
"LV_USE_KB":0,
|
||||
"LV_USE_KEYBOARD":0,
|
||||
"LV_USE_LABEL":1,
|
||||
"LV_USE_LED":0,
|
||||
"LV_USE_LINE":0,
|
||||
"LV_USE_LIST":0,
|
||||
"LV_USE_LMETER":0,
|
||||
"LV_USE_LINEMETER":0,
|
||||
"LV_USE_OBJMASK":0,
|
||||
"LV_USE_MBOX":0,
|
||||
"LV_USE_PAGE":0,
|
||||
"LV_USE_PRELOAD":0,
|
||||
"LV_USE_SPINNER":0,
|
||||
"LV_USE_ROLLER":0,
|
||||
"LV_USE_SLIDER":0,
|
||||
"LV_USE_SPINBOX":0,
|
||||
"LV_USE_SW":0,
|
||||
"LV_USE_TA":0,
|
||||
"LV_USE_SWITCH":0,
|
||||
"LV_USE_TEXTAREA":0,
|
||||
"LV_USE_TABLE":0,
|
||||
"LV_USE_TABVIEW":0,
|
||||
"LV_USE_TILEVIEW":0,
|
||||
@@ -123,8 +130,16 @@ all_obj_minimal_features = {
|
||||
"LV_USE_FILESYSTEM":0,
|
||||
"LV_USE_USER_DATA":0,
|
||||
"LV_USE_LOG":0,
|
||||
"LV_USE_THEME_MATERIAL":1,
|
||||
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"",
|
||||
"LV_THEME_DEFAULT_FLAGS" : "\\\"LV_THEME_MATERIAL_FLAG_NONE\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_USE_DEBUG":0,
|
||||
"LV_THEME_LIVE_UPDATE":0,
|
||||
"LV_FONT_ROBOTO_12":0,
|
||||
"LV_FONT_ROBOTO_16":1,
|
||||
"LV_FONT_ROBOTO_22":0,
|
||||
@@ -132,7 +147,6 @@ all_obj_minimal_features = {
|
||||
"LV_FONT_ROBOTO_12_SUBPX":0,
|
||||
"LV_FONT_ROBOTO_28_COMPRESSED":0,
|
||||
"LV_FONT_UNSCII_8":0,
|
||||
"LV_FONT_DEFAULT":"\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_USE_BIDI": 0,
|
||||
"LV_USE_OBJ_REALIGN": 0,
|
||||
"LV_USE_EXT_CLICK_AREA":"LV_EXT_CLICK_AREA_TINY",
|
||||
@@ -142,29 +156,29 @@ all_obj_minimal_features = {
|
||||
"LV_USE_BTNM":1,
|
||||
"LV_USE_CALENDAR":1,
|
||||
"LV_USE_CANVAS":1,
|
||||
"LV_USE_CB":1,
|
||||
"LV_USE_CHECKBOX":1,
|
||||
"LV_USE_CHART":1,
|
||||
"LV_USE_CONT":1,
|
||||
"LV_USE_CPICKER":1,
|
||||
"LV_USE_DDLIST":1,
|
||||
"LV_USE_DROPDOWN":1,
|
||||
"LV_USE_GAUGE":1,
|
||||
"LV_USE_IMG":1,
|
||||
"LV_USE_IMGBTN":1,
|
||||
"LV_USE_KB":1,
|
||||
"LV_USE_KEYBOARD":1,
|
||||
"LV_USE_LABEL":1,
|
||||
"LV_USE_LED":1,
|
||||
"LV_USE_LINE":1,
|
||||
"LV_USE_LIST":1,
|
||||
"LV_USE_LMETER":1,
|
||||
"LV_USE_LINEMETER":1,
|
||||
"LV_USE_OBJMASK":1,
|
||||
"LV_USE_MBOX":1,
|
||||
"LV_USE_PAGE":1,
|
||||
"LV_USE_PRELOAD":0, #Disabled beacsue needs anim
|
||||
"LV_USE_SPINNER":0, #Disabled beacsue needs anim
|
||||
"LV_USE_ROLLER":1,
|
||||
"LV_USE_SLIDER":1,
|
||||
"LV_USE_SPINBOX":1,
|
||||
"LV_USE_SW":1,
|
||||
"LV_USE_TA":1,
|
||||
"LV_USE_SWITCH":1,
|
||||
"LV_USE_TEXTAREA":1,
|
||||
"LV_USE_TABLE":1,
|
||||
"LV_USE_TABVIEW":1,
|
||||
"LV_USE_TILEVIEW":1,
|
||||
@@ -184,15 +198,15 @@ all_obj_all_features = {
|
||||
"LV_USE_FILESYSTEM":1,
|
||||
"LV_USE_USER_DATA":1,
|
||||
"LV_USE_LOG":1,
|
||||
"LV_THEME_LIVE_UPDATE":1,
|
||||
"LV_USE_THEME_TEMPL":1,
|
||||
"LV_USE_THEME_DEFAULT":1,
|
||||
"LV_USE_THEME_ALIEN":1,
|
||||
"LV_USE_THEME_NIGHT":1,
|
||||
"LV_USE_THEME_MONO":1,
|
||||
"LV_USE_THEME_MATERIAL":1,
|
||||
"LV_USE_THEME_ZEN":1,
|
||||
"LV_USE_THEME_NEMO": 1,
|
||||
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"",
|
||||
"LV_THEME_DEFAULT_FLAGS" : "\\\"LV_THEME_MATERIAL_FLAG_NONE\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_roboto_12\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_roboto_22\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_roboto_28\\\"",
|
||||
"LV_FONT_ROBOTO_12":1,
|
||||
"LV_FONT_ROBOTO_16":1,
|
||||
"LV_FONT_ROBOTO_22":1,
|
||||
@@ -200,36 +214,35 @@ all_obj_all_features = {
|
||||
"LV_FONT_ROBOTO_12_SUBPX":1,
|
||||
"LV_FONT_ROBOTO_28_COMPRESSED":1,
|
||||
"LV_FONT_UNSCII_8":1,
|
||||
"LV_FONT_DEFAULT":"\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_USE_ARC":1,
|
||||
"LV_USE_BAR":1,
|
||||
"LV_USE_BTN":1,
|
||||
"LV_USE_BTNM":1,
|
||||
"LV_USE_CALENDAR":1,
|
||||
"LV_USE_CANVAS":1,
|
||||
"LV_USE_CB":1,
|
||||
"LV_USE_CHECKBOX":1,
|
||||
"LV_USE_CHART":1,
|
||||
"LV_USE_CONT":1,
|
||||
"LV_USE_CPICKER":1,
|
||||
"LV_USE_DDLIST":1,
|
||||
"LV_USE_DROPDOWN":1,
|
||||
"LV_USE_GAUGE":1,
|
||||
"LV_USE_IMG":1,
|
||||
"LV_USE_IMGBTN":1,
|
||||
"LV_USE_KB":1,
|
||||
"LV_USE_KEYBOARD":1,
|
||||
"LV_USE_LABEL":1,
|
||||
"LV_USE_LED":1,
|
||||
"LV_USE_LINE":1,
|
||||
"LV_USE_LIST":1,
|
||||
"LV_USE_LMETER":1,
|
||||
"LV_USE_LINEMETER":1,
|
||||
"LV_USE_OBJMASK":1,
|
||||
"LV_USE_MBOX":1,
|
||||
"LV_USE_PAGE":1,
|
||||
"LV_USE_PRELOAD":1,
|
||||
"LV_USE_SPINNER":1,
|
||||
"LV_USE_ROLLER":1,
|
||||
"LV_USE_SLIDER":1,
|
||||
"LV_USE_SPINBOX":1,
|
||||
"LV_USE_SW":1,
|
||||
"LV_USE_TA":1,
|
||||
"LV_USE_SWITCH":1,
|
||||
"LV_USE_TEXTAREA":1,
|
||||
"LV_USE_TABLE":1,
|
||||
"LV_USE_TABVIEW":1,
|
||||
"LV_USE_TILEVIEW":1,
|
||||
@@ -253,6 +266,15 @@ advanced_features = {
|
||||
"LV_USE_USER_DATA":1,
|
||||
"LV_IMG_CACHE_DEF_SIZE":32,
|
||||
"LV_USE_LOG":1,
|
||||
"LV_USE_THEME_MATERIAL":1,
|
||||
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_PRIMARY": "\\\"LV_COLOR_RED\\\"",
|
||||
"LV_THEME_DEFAULT_COLOR_SECONDARY": "\\\"LV_COLOR_BLUE\\\"",
|
||||
"LV_THEME_DEFAULT_FLAGS" : "\\\"LV_THEME_MATERIAL_FLAG_NONE\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_roboto_12\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_roboto_22\\\"",
|
||||
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_roboto_28\\\"",
|
||||
"LV_LOG_PRINTF":1,
|
||||
"LV_USE_DEBUG":1,
|
||||
"LV_USE_ASSERT_NULL":1,
|
||||
@@ -260,15 +282,7 @@ advanced_features = {
|
||||
"LV_USE_ASSERT_STR":1,
|
||||
"LV_USE_ASSERT_OBJ":1,
|
||||
"LV_USE_ASSERT_STYLE":1,
|
||||
"LV_THEME_LIVE_UPDATE":1,
|
||||
"LV_USE_THEME_TEMPL":1,
|
||||
"LV_USE_THEME_DEFAULT":1,
|
||||
"LV_USE_THEME_ALIEN":1,
|
||||
"LV_USE_THEME_NIGHT":1,
|
||||
"LV_USE_THEME_MONO":1,
|
||||
"LV_USE_THEME_MATERIAL":1,
|
||||
"LV_USE_THEME_ZEN":1,
|
||||
"LV_USE_THEME_NEMO": 1,
|
||||
"LV_FONT_ROBOTO_12":1,
|
||||
"LV_FONT_ROBOTO_16":1,
|
||||
"LV_FONT_ROBOTO_22":1,
|
||||
@@ -276,7 +290,6 @@ advanced_features = {
|
||||
"LV_FONT_ROBOTO_12_SUBPX":1,
|
||||
"LV_FONT_ROBOTO_28_COMPRESSED":1,
|
||||
"LV_FONT_UNSCII_8":1,
|
||||
"LV_FONT_DEFAULT":"\\\"&lv_font_roboto_16\\\"",
|
||||
"LV_USE_BIDI": 1,
|
||||
"LV_USE_OBJ_REALIGN": 1,
|
||||
"LV_FONT_FMT_TXT_LARGE":1,
|
||||
@@ -290,29 +303,29 @@ advanced_features = {
|
||||
"LV_USE_BTNM":1,
|
||||
"LV_USE_CALENDAR":1,
|
||||
"LV_USE_CANVAS":1,
|
||||
"LV_USE_CB":1,
|
||||
"LV_USE_CHECKBOX":1,
|
||||
"LV_USE_CHART":1,
|
||||
"LV_USE_CONT":1,
|
||||
"LV_USE_CPICKER":1,
|
||||
"LV_USE_DDLIST":1,
|
||||
"LV_USE_DROPDOWN":1,
|
||||
"LV_USE_GAUGE":1,
|
||||
"LV_USE_IMG":1,
|
||||
"LV_USE_IMGBTN":1,
|
||||
"LV_USE_KB":1,
|
||||
"LV_USE_KEYBOARD":1,
|
||||
"LV_USE_LABEL":1,
|
||||
"LV_USE_LED":1,
|
||||
"LV_USE_LINE":1,
|
||||
"LV_USE_LIST":1,
|
||||
"LV_USE_LMETER":1,
|
||||
"LV_USE_LINEMETER":1,
|
||||
"LV_USE_OBJMASK":1,
|
||||
"LV_USE_MBOX":1,
|
||||
"LV_USE_PAGE":1,
|
||||
"LV_USE_PRELOAD":1,
|
||||
"LV_USE_SPINNER":1,
|
||||
"LV_USE_ROLLER":1,
|
||||
"LV_USE_SLIDER":1,
|
||||
"LV_USE_SPINBOX":1,
|
||||
"LV_USE_SW":1,
|
||||
"LV_USE_TA":1,
|
||||
"LV_USE_SWITCH":1,
|
||||
"LV_USE_TEXTAREA":1,
|
||||
"LV_USE_TABLE":1,
|
||||
"LV_USE_TABVIEW":1,
|
||||
"LV_USE_TILEVIEW":1,
|
||||
|
||||
@@ -208,11 +208,10 @@ void read_png_file(png_img_t * p, const char* file_name)
|
||||
FILE *fp = fopen(file_name, "rb");
|
||||
if (!fp)
|
||||
lv_test_exit("[read_png_file] File %s could not be opened for reading", file_name);
|
||||
fread(header, 1, 8, fp);
|
||||
if (png_sig_cmp((png_const_bytep)header, 0, 8))
|
||||
size_t rcnt = fread(header, 1, 8, fp);
|
||||
if (rcnt != 8 || png_sig_cmp((png_const_bytep)header, 0, 8))
|
||||
lv_test_exit("[read_png_file] File %s is not recognized as a PNG file", file_name);
|
||||
|
||||
|
||||
/* initialize stuff */
|
||||
p->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ extern "C" {
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_test_core(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
@@ -126,10 +126,10 @@ static void add_remove_read_prop(void)
|
||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'color' property");
|
||||
|
||||
lv_test_print("Set properties and read back the values");
|
||||
lv_style_set_int(&style, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
lv_style_set_opa(&style, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
lv_style_set_ptr(&style, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT);
|
||||
lv_style_set_color(&style, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_int(&style, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
_lv_style_set_opa(&style, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
_lv_style_set_ptr(&style, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL);
|
||||
_lv_style_set_color(&style, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'int' property");
|
||||
@@ -141,7 +141,7 @@ static void add_remove_read_prop(void)
|
||||
|
||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT, ptr, "Get the value of a 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL, ptr, "Get the value of a 'ptr' property");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'color' property");
|
||||
@@ -191,10 +191,10 @@ static void cascade(void)
|
||||
|
||||
lv_test_print("Read properties set only in the firstly added style");
|
||||
|
||||
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
lv_style_set_ptr(&style_first, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT);
|
||||
lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
_lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
_lv_style_set_ptr(&style_first, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL);
|
||||
_lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property");
|
||||
@@ -206,7 +206,7 @@ static void cascade(void)
|
||||
|
||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT, ptr, "Get the value of a 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL, ptr, "Get the value of a 'ptr' property");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'color' property");
|
||||
@@ -214,10 +214,10 @@ static void cascade(void)
|
||||
|
||||
lv_test_print("Overwrite the properties from the second style");
|
||||
|
||||
lv_style_set_int(&style_second, LV_STYLE_TEXT_LINE_SPACE, 10);
|
||||
lv_style_set_opa(&style_second, LV_STYLE_BG_OPA, LV_OPA_60);
|
||||
lv_style_set_ptr(&style_second, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT + 1);
|
||||
lv_style_set_color(&style_second, LV_STYLE_BG_COLOR, LV_COLOR_BLUE);
|
||||
_lv_style_set_int(&style_second, LV_STYLE_TEXT_LINE_SPACE, 10);
|
||||
_lv_style_set_opa(&style_second, LV_STYLE_BG_OPA, LV_OPA_60);
|
||||
_lv_style_set_ptr(&style_second, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL + 1);
|
||||
_lv_style_set_color(&style_second, LV_STYLE_BG_COLOR, LV_COLOR_BLUE);
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'int' property");
|
||||
@@ -229,7 +229,7 @@ static void cascade(void)
|
||||
|
||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT + 1, ptr, "Get the value of an overwritten 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL + 1, ptr, "Get the value of an overwritten 'ptr' property");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'color' property");
|
||||
@@ -239,7 +239,7 @@ static void cascade(void)
|
||||
lv_test_print("Overwrite the properties with the local style");
|
||||
lv_style_list_set_local_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, 20);
|
||||
lv_style_list_set_local_opa(&style_list, LV_STYLE_BG_OPA, LV_OPA_70);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT + 2);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT, LV_THEME_DEFAULT_FONT_NORMAL + 2);
|
||||
lv_style_list_set_local_color(&style_list, LV_STYLE_BG_COLOR, LV_COLOR_LIME);
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||
@@ -252,7 +252,7 @@ static void cascade(void)
|
||||
|
||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT + 2, ptr, "Get the value of a local'ptr' property");
|
||||
lv_test_assert_ptr_eq(LV_THEME_DEFAULT_FONT_NORMAL + 2, ptr, "Get the value of a local'ptr' property");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'color' property");
|
||||
@@ -273,15 +273,16 @@ static void copy(void)
|
||||
lv_test_print("Copy a style");
|
||||
lv_style_t style_src;
|
||||
lv_style_init(&style_src);
|
||||
lv_style_set_int(&style_src, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
_lv_style_set_int(&style_src, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
|
||||
lv_style_t style_dest;
|
||||
lv_style_init(&style_dest);
|
||||
lv_style_copy(&style_dest, &style_src);
|
||||
|
||||
int16_t weight;
|
||||
lv_style_int_t value;
|
||||
|
||||
weight = lv_style_get_int(&style_dest, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||
weight = _lv_style_get_int(&style_dest, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||
lv_test_assert_int_eq(0, weight, "Get a copied property from a style");
|
||||
lv_test_assert_int_eq(5, value, "Get the value of a copied from a property");
|
||||
|
||||
@@ -329,9 +330,9 @@ static void states(void)
|
||||
lv_style_list_add_style(&style_list, &style_second);
|
||||
|
||||
lv_test_print("Test state precedence in 1 style");
|
||||
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_CHECKED, 6);
|
||||
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_PRESSED, 7);
|
||||
_lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||
_lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, 6);
|
||||
_lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, 7);
|
||||
|
||||
lv_res_t found;
|
||||
lv_style_int_t value;
|
||||
@@ -340,25 +341,25 @@ static void states(void)
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in normal state");
|
||||
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property in normal state");
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_CHECKED, &value);
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked state");
|
||||
lv_test_assert_int_eq(6, value, "Get the value of an 'int' in checked state");
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_PRESSED, &value);
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in pressed state");
|
||||
lv_test_assert_int_eq(7, value, "Get the value of an 'int' in pressed state");
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_HOVER, &value);
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in hover (unspecified) state");
|
||||
lv_test_assert_int_eq(5, value, "Get the value of an 'int' in hover (unspecified) state");
|
||||
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_PRESSED | LV_STYLE_STATE_HOVER, &value);
|
||||
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | (LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &value);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked pressed hovered state");
|
||||
lv_test_assert_int_eq(7, value, "Get the value of an 'int' in checked pressed hovered state");
|
||||
|
||||
lv_test_print("Test state precedence in 1 style with combined states");
|
||||
lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
lv_style_set_opa(&style_first, LV_STYLE_BG_OPA | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_PRESSED, LV_OPA_60);
|
||||
_lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
_lv_style_set_opa(&style_first, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_OPA_60);
|
||||
|
||||
|
||||
lv_opa_t opa;
|
||||
@@ -366,24 +367,24 @@ static void states(void)
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in normal state");
|
||||
lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'int' in normal state");
|
||||
|
||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | LV_STYLE_STATE_CHECKED, &opa);
|
||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &opa);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked (unspecified) state");
|
||||
lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'int' in checked (unspecified) state");
|
||||
|
||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_PRESSED, &opa);
|
||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &opa);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked pressed state");
|
||||
lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an 'int' in checked pressed state");
|
||||
|
||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_PRESSED | LV_STYLE_STATE_HOVER, &opa);
|
||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA | (LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &opa);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property in checked pressed hovered state");
|
||||
lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an 'int' in checked pressed hovered state");
|
||||
|
||||
|
||||
lv_test_print("Test state precedence in 2 styles");
|
||||
lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_YELLOW);
|
||||
lv_style_set_color(&style_first, LV_STYLE_BG_COLOR | LV_STYLE_STATE_HOVER, LV_COLOR_RED);
|
||||
lv_style_set_color(&style_second, LV_STYLE_BG_COLOR | LV_STYLE_STATE_CHECKED, LV_COLOR_LIME);
|
||||
lv_style_set_color(&style_second, LV_STYLE_BG_COLOR | LV_STYLE_STATE_HOVER | LV_STYLE_STATE_PRESSED, LV_COLOR_BLUE);
|
||||
_lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_YELLOW);
|
||||
_lv_style_set_color(&style_first, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style_second, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, LV_COLOR_LIME);
|
||||
_lv_style_set_color(&style_second, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_COLOR_BLUE);
|
||||
|
||||
lv_color_t color;
|
||||
|
||||
@@ -391,23 +392,23 @@ static void states(void)
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in normal state");
|
||||
lv_test_assert_color_eq(LV_COLOR_YELLOW, color, "Get the value of a 'color' property in normal state");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | LV_STYLE_STATE_HOVER, &color);
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED) << LV_STYLE_STATE_POS, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in hovered state");
|
||||
lv_test_assert_color_eq(LV_COLOR_RED, color, "Get the value of a 'color' in hovered state");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | LV_STYLE_STATE_CHECKED, &color);
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED) << LV_STYLE_STATE_POS, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in checked state");
|
||||
lv_test_assert_color_eq(LV_COLOR_LIME, color, "Get the value of a 'color' in checked state");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | LV_STYLE_STATE_HOVER | LV_STYLE_STATE_PRESSED, &color);
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_HOVERED | LV_STATE_PRESSED) << LV_STYLE_STATE_POS, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in hover pressed state");
|
||||
lv_test_assert_color_eq(LV_COLOR_BLUE, color, "Get the value of a 'color' in hover pressed state");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | LV_STYLE_STATE_EDIT, &color);
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_EDITED) << LV_STYLE_STATE_POS, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in edit (unspecified) state");
|
||||
lv_test_assert_color_eq(LV_COLOR_YELLOW, color, "Get the value of a 'color' in edit (unspecified) state");
|
||||
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_EDIT, &color);
|
||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR | (LV_STATE_CHECKED | LV_STATE_EDITED) << LV_STYLE_STATE_POS, &color);
|
||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a 'color' property in checked edit state");
|
||||
lv_test_assert_color_eq(LV_COLOR_LIME, color, "Get the value of a 'color' in checked edit state");
|
||||
|
||||
@@ -443,16 +444,16 @@ static void mem_leak(void)
|
||||
lv_test_print("Set style properties");
|
||||
lv_mem_monitor(&mon_start);
|
||||
for(i = 0; i < 100; i++) {
|
||||
lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
|
||||
lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&style3, LV_STYLE_LINE_COLOR | LV_STYLE_STATE_EDIT, LV_COLOR_BLUE);
|
||||
lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_BLUE);
|
||||
lv_style_set_color(&style3, LV_STYLE_LINE_COLOR | LV_STYLE_STATE_EDIT | LV_STYLE_STATE_FOCUS, LV_COLOR_GREEN);
|
||||
_lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style3, LV_STYLE_LINE_COLOR | (LV_STATE_EDITED) << LV_STYLE_STATE_POS, LV_COLOR_BLUE);
|
||||
_lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_BLUE);
|
||||
_lv_style_set_color(&style3, LV_STYLE_LINE_COLOR | (LV_STATE_EDITED | LV_STATE_FOCUSED) << LV_STYLE_STATE_POS, LV_COLOR_GREEN);
|
||||
|
||||
lv_style_set_color(&style3, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style3, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
|
||||
lv_style_set_color(&style3, LV_STYLE_IMAGE_RECOLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style3, LV_STYLE_IMAGE_RECOLOR, LV_COLOR_RED);
|
||||
|
||||
lv_style_reset(&style1);
|
||||
lv_style_reset(&style2);
|
||||
@@ -468,11 +469,11 @@ static void mem_leak(void)
|
||||
lv_test_print("Use local style");
|
||||
lv_mem_monitor(&mon_start);
|
||||
for(i = 0; i < 100; i++) {
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, LV_FONT_DEFAULT);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_THEME_DEFAULT_FONT_NORMAL);
|
||||
|
||||
lv_style_list_reset(&style_list);
|
||||
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, NULL);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, NULL);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||
@@ -493,9 +494,9 @@ static void mem_leak(void)
|
||||
lv_test_print("Add styles");
|
||||
lv_mem_monitor(&mon_start);
|
||||
for(i = 0; i < 100; i++) {
|
||||
lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
|
||||
lv_style_list_add_style(&style_list, &style1);
|
||||
lv_style_list_remove_style(&style_list, &style1);
|
||||
@@ -520,9 +521,9 @@ static void mem_leak(void)
|
||||
lv_test_print("Add styles and use local style");
|
||||
lv_mem_monitor(&mon_start);
|
||||
for(i = 0; i < 100; i++) {
|
||||
lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style2, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style3, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
|
||||
if(i % 2 == 0) lv_style_list_set_local_color(&style_list, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
|
||||
@@ -560,10 +561,10 @@ static void mem_leak(void)
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_CLOSE);
|
||||
}
|
||||
|
||||
lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&style1, LV_STYLE_LINE_COLOR | LV_STYLE_STATE_EDIT, LV_COLOR_BLUE);
|
||||
lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_BLUE);
|
||||
lv_style_set_color(&style1, LV_STYLE_LINE_COLOR | LV_STYLE_STATE_EDIT | LV_STYLE_STATE_FOCUS, LV_COLOR_GREEN);
|
||||
_lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_RED);
|
||||
_lv_style_set_color(&style1, LV_STYLE_LINE_COLOR | (LV_STATE_EDITED) << LV_STYLE_STATE_POS, LV_COLOR_BLUE);
|
||||
_lv_style_set_color(&style1, LV_STYLE_LINE_COLOR, LV_COLOR_BLUE);
|
||||
_lv_style_set_color(&style1, LV_STYLE_LINE_COLOR | (LV_STATE_EDITED | LV_STATE_FOCUSED) << LV_STYLE_STATE_POS, LV_COLOR_GREEN);
|
||||
|
||||
lv_style_list_add_style(&style_list, &style1);
|
||||
|
||||
@@ -574,12 +575,12 @@ static void mem_leak(void)
|
||||
|
||||
lv_style_list_remove_style(&style_list, &style1);
|
||||
|
||||
lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_10);
|
||||
lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_20);
|
||||
lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_30);
|
||||
lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_40);
|
||||
lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_50);
|
||||
lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_60);
|
||||
_lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_10);
|
||||
_lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_20);
|
||||
_lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_30);
|
||||
_lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_40);
|
||||
_lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_50);
|
||||
_lv_style_set_opa(&style2, LV_STYLE_TEXT_OPA, LV_OPA_60);
|
||||
|
||||
lv_style_list_add_style(&style_list, &style2);
|
||||
|
||||
@@ -593,17 +594,17 @@ static void mem_leak(void)
|
||||
lv_style_list_add_style(&style_list, &style2);
|
||||
lv_style_list_remove_style(&style_list, &style2);
|
||||
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 10);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 20);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 11);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 21);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 22);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12);
|
||||
lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 23);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 10);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 20);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 11);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 21);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 22);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12);
|
||||
_lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 23);
|
||||
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, LV_FONT_DEFAULT);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, NULL);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, LV_THEME_DEFAULT_FONT_NORMAL);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | (LV_STATE_PRESSED) << LV_STYLE_STATE_POS, NULL);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#include "../lvgl.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include "lv_test_core/lv_test_core.h"
|
||||
|
||||
#if LV_BUILD_TEST
|
||||
|
||||
|
||||
static void hal_init(void);
|
||||
static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
|
||||
|
||||
int main2(void)
|
||||
int main(void)
|
||||
{
|
||||
printf("Call lv_init...\n");
|
||||
lv_init();
|
||||
@@ -17,7 +18,6 @@ int main2(void)
|
||||
|
||||
lv_test_core();
|
||||
|
||||
|
||||
printf("Exit with success!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user