mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
merge dev-6.1
This commit is contained in:
commit
7a707ff94c
@ -232,6 +232,42 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
|
||||
# define LV_LOG_PRINTF 0
|
||||
#endif /*LV_USE_LOG*/
|
||||
|
||||
/*=================
|
||||
* Debug settings
|
||||
*================*/
|
||||
|
||||
/* If Debug is enabled LittelvGL validates the parameters of the functions.
|
||||
* If an invalid parameter is found an error log message is printed and
|
||||
* the MCU halts at the error. (`LV_USE_LOG` should be enabled)
|
||||
* If you are debugging the MCU you can pause
|
||||
* the debugger to see exactly where the issue is.
|
||||
*
|
||||
* The behavior of asserts can be overwritten by redefining them here.
|
||||
* E.g. #define LV_ASSERT_MEM(p) <my_assert_code>
|
||||
*/
|
||||
#define LV_USE_DEBUG 1
|
||||
#if LV_USE_DEBUG
|
||||
|
||||
/*Check if the parameter is NULL. (Quite fast) */
|
||||
#define LV_USE_ASSERT_NULL 1
|
||||
|
||||
/*Checks is the memory is successfully allocated or no. (Quite fast)*/
|
||||
#define LV_USE_ASSERT_MEM 1
|
||||
|
||||
/* Check the strings.
|
||||
* Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
|
||||
* If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
|
||||
#define LV_USE_ASSERT_STR 0
|
||||
|
||||
/* Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)
|
||||
* If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
|
||||
#define LV_USE_ASSERT_OBJ 0
|
||||
|
||||
/*Check if the styles are properly initialized. (Fast)*/
|
||||
#define LV_USE_ASSERT_STYLE 1
|
||||
|
||||
#endif /*LV_USE_DEBUG*/
|
||||
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
|
@ -312,6 +312,54 @@
|
||||
#endif
|
||||
#endif /*LV_USE_LOG*/
|
||||
|
||||
/*=================
|
||||
* Debug settings
|
||||
*================*/
|
||||
|
||||
/* If Debug is enabled LittelvGL validates the parameters of the functions.
|
||||
* If an invalid parameter is found an error log message is printed and
|
||||
* the MCU halts at the error. (`LV_USE_LOG` should be enabled)
|
||||
* If you are debugging the MCU you can pause
|
||||
* the debugger to see exactly where the issue is.
|
||||
*
|
||||
* The behavior of asserts can be overwritten by redefining them here.
|
||||
* E.g. #define LV_ASSERT_MEM(p) <my_assert_code>
|
||||
*/
|
||||
#ifndef LV_USE_DEBUG
|
||||
#define LV_USE_DEBUG 1
|
||||
#endif
|
||||
#if LV_USE_DEBUG
|
||||
|
||||
/*Check if the parameter is NULL. (Quite fast) */
|
||||
#ifndef LV_USE_ASSERT_NULL
|
||||
#define LV_USE_ASSERT_NULL 1
|
||||
#endif
|
||||
|
||||
/*Checks is the memory is successfully allocated or no. (Quite fast)*/
|
||||
#ifndef LV_USE_ASSERT_MEM
|
||||
#define LV_USE_ASSERT_MEM 1
|
||||
#endif
|
||||
|
||||
/* Check the strings.
|
||||
* Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
|
||||
* If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
|
||||
#ifndef LV_USE_ASSERT_STR
|
||||
#define LV_USE_ASSERT_STR 0
|
||||
#endif
|
||||
|
||||
/* Check NULL, the object's type and existence (e.g. not deleted). (Quite slow)
|
||||
* If disabled `LV_USE_ASSERT_NULL` will be performed instead (if it's enabled) */
|
||||
#ifndef LV_USE_ASSERT_OBJ
|
||||
#define LV_USE_ASSERT_OBJ 0
|
||||
#endif
|
||||
|
||||
/*Check if the styles are properly initialized. (Fast)*/
|
||||
#ifndef LV_USE_ASSERT_STYLE
|
||||
#define LV_USE_ASSERT_STYLE 1
|
||||
#endif
|
||||
|
||||
#endif /*LV_USE_DEBUG*/
|
||||
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
|
@ -8,12 +8,18 @@
|
||||
*********************/
|
||||
#include "lv_obj.h"
|
||||
|
||||
#if LV_USE_DEBUG
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#ifndef LV_DEBUG_STR_MAX_LENGTH
|
||||
#define LV_DEBUG_STR_MAX_LENGTH (1024 * 8)
|
||||
#define LV_DEBUG_STR_MAX_REPEAT 8
|
||||
#endif
|
||||
|
||||
#ifndef LV_DEBUG_STR_MAX_REPEAT
|
||||
#define LV_DEBUG_STR_MAX_REPEAT 8
|
||||
#endif
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@ -75,12 +81,18 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool lv_debug_check_style(const void * str)
|
||||
bool lv_debug_check_style(const lv_style_t * style)
|
||||
{
|
||||
return true;
|
||||
if(style == NULL) return true; /*NULL style is still valid*/
|
||||
|
||||
LV_LOG_WARN("Invalid style (local variable or not initialized?)");
|
||||
return false;
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
if(style->debug_sentinel != LV_STYLE_DEGUG_SENTINEL_VALUE) {
|
||||
LV_LOG_WARN("Invalid style (local variable or not initialized?)");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool lv_debug_check_str(const void * str)
|
||||
@ -94,10 +106,10 @@ bool lv_debug_check_str(const void * str)
|
||||
if(s[i] != last_byte) {
|
||||
last_byte = s[i];
|
||||
rep = 1;
|
||||
} else {
|
||||
} else if(s[i] > 0x7F){
|
||||
rep++;
|
||||
if(rep > LV_DEBUG_STR_MAX_REPEAT) {
|
||||
LV_LOG_WARN("lv_debug_check_str: a char has repeated more than LV_DEBUG_STR_MAX_REPEAT times)");
|
||||
LV_LOG_WARN("lv_debug_check_str: a non-ASCII char has repeated more than LV_DEBUG_STR_MAX_REPEAT times)");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -175,3 +187,6 @@ static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_fin
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DEBUG*/
|
||||
|
||||
|
@ -15,6 +15,8 @@ extern "C" {
|
||||
*********************/
|
||||
#include "lv_obj.h"
|
||||
|
||||
#if LV_USE_DEBUG
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@ -62,7 +64,8 @@ void lv_debug_log_error(const char * msg, uint64_t value);
|
||||
#endif
|
||||
|
||||
#ifndef LV_DEBUG_IS_STR
|
||||
#define LV_DEBUG_IS_STR(str) (lv_debug_check_str(str))
|
||||
#define LV_DEBUG_IS_STR(str) (lv_debug_check_null(str) && \
|
||||
lv_debug_check_str(str))
|
||||
#endif
|
||||
|
||||
#ifndef LV_DEBUG_IS_OBJ
|
||||
@ -101,8 +104,12 @@ void lv_debug_log_error(const char * msg, uint64_t value);
|
||||
# ifndef LV_ASSERT_STR
|
||||
# define LV_ASSERT_STR(str) LV_DEBUG_ASSERT(LV_DEBUG_IS_STR(str), "Strange or invalid string", str);
|
||||
# endif
|
||||
#else
|
||||
# define LV_ASSERT_STR(p) true
|
||||
#else /* LV_USE_ASSERT_OBJ == 0 */
|
||||
# if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/
|
||||
# define LV_ASSERT_STR(str) LV_ASSERT_NULL(str)
|
||||
# else
|
||||
# define LV_ASSERT_STR(str) true
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -110,8 +117,12 @@ void lv_debug_log_error(const char * msg, uint64_t value);
|
||||
# ifndef LV_ASSERT_OBJ
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_DEBUG_ASSERT(LV_DEBUG_IS_OBJ(obj_p, obj_type), "Invalid object", obj_p);
|
||||
# endif
|
||||
#else
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) true
|
||||
#else /* LV_USE_ASSERT_OBJ == 0 */
|
||||
# if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_ASSERT_NULL(obj_p)
|
||||
# else
|
||||
# define LV_ASSERT_OBJ(obj_p, obj_type) true
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -123,6 +134,15 @@ void lv_debug_log_error(const char * msg, uint64_t value);
|
||||
# define LV_ASSERT_STYLE(style) true
|
||||
#endif
|
||||
|
||||
#else /* LV_USE_DEBUG == 0 */
|
||||
|
||||
#define LV_ASSERT_NULL(p) true
|
||||
#define LV_ASSERT_MEM(p) true
|
||||
#define LV_ASSERT_STR(p) true
|
||||
#define LV_ASSERT_OBJ(obj, obj_type) true
|
||||
#define LV_ASSERT_STYLE(p) true
|
||||
|
||||
#endif /* LV_USE_DEBUG */
|
||||
/*clang-format on*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -119,6 +119,12 @@ void lv_style_init(void)
|
||||
lv_style_scr.line.rounded = 0;
|
||||
lv_style_scr.line.blend_mode = LV_BLEND_MODE_NORMAL;
|
||||
|
||||
#if LV_USE_DEBUG
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
lv_style_scr.debug_sentinel = LV_STYLE_DEGUG_SENTINEL_VALUE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Plain style (by default near the same as the screen style)*/
|
||||
lv_style_copy(&lv_style_plain, &lv_style_scr);
|
||||
lv_style_plain.body.opa = LV_OPA_COVER;
|
||||
|
@ -24,6 +24,7 @@ extern "C" {
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_RADIUS_CIRCLE (LV_COORD_MAX) /**< A very big radius to always draw as circle*/
|
||||
#define LV_STYLE_DEGUG_SENTINEL_VALUE 0x12345678
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@ -135,6 +136,13 @@ typedef struct
|
||||
uint8_t rounded : 1; /**< 1: rounded line endings*/
|
||||
lv_blend_mode_t blend_mode :3;
|
||||
} line;
|
||||
|
||||
#if LV_USE_DEBUG
|
||||
#if LV_USE_ASSERT_STYLE
|
||||
uint32_t debug_sentinel; /**<Should `LV_STYLE_DEGUG_SENTINEL_VALUE` to indicate that the style is valid*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} lv_style_t;
|
||||
|
||||
#if LV_USE_ANIMATION
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -970,26 +970,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
|
||||
|
||||
/* U+F044 "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xae,
|
||||
0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9,
|
||||
0xff, 0xf6, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xb0,
|
||||
0x63, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfd,
|
||||
0x1a, 0xf9, 0x3f, 0xfc, 0xff, 0x0, 0x0, 0x0,
|
||||
0x0, 0xaf, 0xff, 0x93, 0xb1, 0xff, 0x0, 0x0,
|
||||
0x0, 0xa, 0xff, 0xff, 0xf7, 0x0, 0xff, 0x0,
|
||||
0x0, 0x0, 0xaf, 0xff, 0xff, 0xd1, 0x0, 0xff,
|
||||
0x0, 0x0, 0xa, 0xff, 0xff, 0xfd, 0x10, 0x0,
|
||||
0xff, 0x0, 0x0, 0xaf, 0xff, 0xff, 0xd1, 0x0,
|
||||
0x0, 0xff, 0x0, 0x9, 0xff, 0xff, 0xfd, 0x2a,
|
||||
0x0, 0x0, 0xff, 0x0, 0xc, 0xff, 0xff, 0xd1,
|
||||
0xdf, 0x0, 0x0, 0xff, 0x0, 0xf, 0xff, 0xfd,
|
||||
0x10, 0xff, 0x0, 0x0, 0xff, 0x0, 0xf, 0xfc,
|
||||
0xb1, 0x0, 0xff, 0x0, 0x0, 0xff, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x8f,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0,
|
||||
|
||||
/* U+F048 "" */
|
||||
0xff, 0x40, 0x0, 0x1, 0xcc, 0xff, 0x40, 0x0,
|
||||
0x3d, 0xff, 0xff, 0x40, 0x3, 0xef, 0xff, 0xff,
|
||||
@ -1116,6 +1096,44 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x58, 0x88, 0x88,
|
||||
0x88, 0x88, 0x88, 0x85,
|
||||
|
||||
/* U+F06E "" */
|
||||
0x0, 0x0, 0x4, 0xab, 0xff, 0xba, 0x40, 0x0,
|
||||
0x0, 0x0, 0x4, 0xcf, 0xfd, 0x99, 0xdf, 0xfc,
|
||||
0x40, 0x0, 0x0, 0x6f, 0xff, 0x50, 0x0, 0x5,
|
||||
0xff, 0xf6, 0x0, 0x8, 0xff, 0xf5, 0x0, 0xae,
|
||||
0x80, 0x5f, 0xff, 0x80, 0x3f, 0xff, 0xd0, 0x0,
|
||||
0xaf, 0xf9, 0xd, 0xff, 0xf3, 0xdf, 0xff, 0x90,
|
||||
0xa9, 0xff, 0xfe, 0x9, 0xff, 0xfc, 0xef, 0xff,
|
||||
0x90, 0xff, 0xff, 0xff, 0x9, 0xff, 0xfd, 0x4f,
|
||||
0xff, 0xc0, 0x8f, 0xff, 0xf8, 0xd, 0xff, 0xf3,
|
||||
0x7, 0xff, 0xf5, 0x8, 0xff, 0x90, 0x5f, 0xff,
|
||||
0x80, 0x0, 0x8f, 0xfe, 0x50, 0x0, 0x5, 0xef,
|
||||
0xf6, 0x0, 0x0, 0x4, 0xef, 0xfc, 0x88, 0xcf,
|
||||
0xfd, 0x40, 0x0, 0x0, 0x0, 0x5, 0xad, 0xff,
|
||||
0xcb, 0x40, 0x0, 0x0,
|
||||
|
||||
/* U+F070 "" */
|
||||
0x9c, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0xdf, 0xe5, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x1b, 0xff, 0x70, 0x59,
|
||||
0xcf, 0xfb, 0xa4, 0x0, 0x0, 0x0, 0x0, 0x8f,
|
||||
0xfe, 0xff, 0xd8, 0x9d, 0xff, 0xc4, 0x0, 0x0,
|
||||
0x0, 0x4, 0xff, 0xf8, 0x0, 0x0, 0x5f, 0xff,
|
||||
0x60, 0x0, 0x0, 0x0, 0x1d, 0xff, 0x6a, 0xe8,
|
||||
0x5, 0xff, 0xf8, 0x0, 0x4, 0xe3, 0x0, 0x9f,
|
||||
0xfe, 0xff, 0x90, 0xdf, 0xff, 0x30, 0xe, 0xff,
|
||||
0x60, 0x6, 0xff, 0xff, 0xe0, 0x9f, 0xff, 0xc0,
|
||||
0xd, 0xff, 0xf8, 0x0, 0x3d, 0xff, 0xf0, 0x8f,
|
||||
0xff, 0xe0, 0x3, 0xff, 0xfc, 0x0, 0x1, 0xaf,
|
||||
0xf8, 0xdf, 0xff, 0x40, 0x0, 0x8f, 0xff, 0x50,
|
||||
0x0, 0x7, 0xff, 0xff, 0xf7, 0x0, 0x0, 0x6,
|
||||
0xff, 0xe5, 0x0, 0x0, 0x3f, 0xff, 0xb0, 0x0,
|
||||
0x0, 0x0, 0x4d, 0xff, 0xc7, 0x72, 0x1, 0xcf,
|
||||
0xf6, 0x0, 0x0, 0x0, 0x0, 0x4b, 0xcf, 0xfd,
|
||||
0x10, 0x8, 0xff, 0xa1, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x5f, 0xfc, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0xd9,
|
||||
|
||||
/* U+F071 "" */
|
||||
0x0, 0x0, 0x0, 0x3, 0xdd, 0x30, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xb0, 0x0,
|
||||
@ -1474,6 +1492,25 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0xff, 0xf0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0x80,
|
||||
|
||||
/* U+F287 "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xc1, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0xdf, 0xff,
|
||||
0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc,
|
||||
0xa4, 0xaf, 0xf2, 0x0, 0x0, 0x0, 0x1, 0x30,
|
||||
0x0, 0x4f, 0x10, 0x3, 0x10, 0x0, 0x0, 0x0,
|
||||
0x6f, 0xfb, 0x10, 0xc8, 0x0, 0x0, 0x0, 0x0,
|
||||
0x4a, 0x20, 0xff, 0xff, 0x9a, 0xf8, 0x77, 0x77,
|
||||
0x77, 0x77, 0x9f, 0xe7, 0xff, 0xff, 0xa8, 0x89,
|
||||
0xfb, 0x88, 0x88, 0x88, 0xaf, 0xf8, 0x6f, 0xfc,
|
||||
0x0, 0x0, 0x8b, 0x0, 0x0, 0x0, 0x4b, 0x20,
|
||||
0x1, 0x30, 0x0, 0x0, 0x1f, 0x20, 0x33, 0x32,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xc1,
|
||||
0xcf, 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0xbf, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0xcf, 0xf8, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x41,
|
||||
0x0, 0x0,
|
||||
|
||||
/* U+F293 "" */
|
||||
0x0, 0x17, 0xcf, 0xfd, 0x92, 0x0, 0x3, 0xef,
|
||||
0xfe, 0xff, 0xfe, 0x30, 0xd, 0xff, 0xfc, 0x3f,
|
||||
@ -1504,6 +1541,24 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0x9f, 0xf0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xf0, 0x8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80,
|
||||
|
||||
/* U+F304 "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0xfa, 0x10,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, 0xff, 0xc1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xdf, 0xff, 0xfa,
|
||||
0x0, 0x0, 0x0, 0x0, 0x69, 0x1d, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x6, 0xff, 0x91, 0xdf, 0xf8,
|
||||
0x0, 0x0, 0x0, 0x6f, 0xff, 0xf9, 0x1d, 0xa0,
|
||||
0x0, 0x0, 0x6, 0xff, 0xff, 0xff, 0x91, 0x0,
|
||||
0x0, 0x0, 0x6f, 0xff, 0xff, 0xff, 0xa0, 0x0,
|
||||
0x0, 0x6, 0xff, 0xff, 0xff, 0xfa, 0x0, 0x0,
|
||||
0x0, 0x6f, 0xff, 0xff, 0xff, 0xa0, 0x0, 0x0,
|
||||
0x6, 0xff, 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0,
|
||||
0x6f, 0xff, 0xff, 0xff, 0xa0, 0x0, 0x0, 0x0,
|
||||
0xcf, 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0,
|
||||
0xcf, 0xff, 0xff, 0xa0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xff, 0xcc, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
|
||||
/* U+F55A "" */
|
||||
0x0, 0x0, 0x1b, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xe4, 0x0, 0x1, 0xcf, 0xff, 0xff, 0xff,
|
||||
@ -1519,7 +1574,33 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||
0xff, 0xff, 0x0, 0x1d, 0xff, 0xff, 0xfa, 0xef,
|
||||
0xfe, 0x9f, 0xff, 0xff, 0x0, 0x1, 0xdf, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0,
|
||||
0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4
|
||||
0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4,
|
||||
|
||||
/* U+F7C2 "" */
|
||||
0x0, 0x6, 0xff, 0xff, 0xff, 0xe4, 0x0, 0x6f,
|
||||
0xff, 0xff, 0xff, 0xfe, 0x6, 0xf8, 0xf, 0x8,
|
||||
0x80, 0xff, 0x6f, 0xf8, 0xf, 0x8, 0x80, 0xff,
|
||||
0xff, 0xf8, 0xf, 0x8, 0x80, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xfe, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xf4,
|
||||
|
||||
/* U+F8A2 "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xcf,
|
||||
0x0, 0x9, 0xe0, 0x0, 0x0, 0x0, 0x8, 0xff,
|
||||
0x0, 0xaf, 0xf0, 0x0, 0x0, 0x0, 0x8, 0xff,
|
||||
0xa, 0xff, 0xf3, 0x33, 0x33, 0x33, 0x39, 0xff,
|
||||
0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xa, 0xff, 0xf4, 0x44, 0x44, 0x44, 0x44, 0x43,
|
||||
0x0, 0xaf, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x9, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
@ -1639,43 +1720,48 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
{.bitmap_index = 5263, .adv_w = 192, .box_h = 12, .box_w = 12, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 5335, .adv_w = 288, .box_h = 16, .box_w = 18, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 5479, .adv_w = 256, .box_h = 12, .box_w = 16, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 5575, .adv_w = 288, .box_h = 16, .box_w = 18, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 5719, .adv_w = 224, .box_h = 14, .box_w = 10, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 5789, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 5901, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 5999, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6097, .adv_w = 224, .box_h = 14, .box_w = 10, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 6167, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6265, .adv_w = 160, .box_h = 14, .box_w = 10, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6335, .adv_w = 160, .box_h = 14, .box_w = 10, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6405, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6503, .adv_w = 224, .box_h = 4, .box_w = 14, .ofs_x = 0, .ofs_y = 4},
|
||||
{.bitmap_index = 6531, .adv_w = 288, .box_h = 16, .box_w = 18, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 6675, .adv_w = 256, .box_h = 14, .box_w = 16, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6787, .adv_w = 224, .box_h = 10, .box_w = 14, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 6857, .adv_w = 224, .box_h = 10, .box_w = 14, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 6927, .adv_w = 320, .box_h = 12, .box_w = 20, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 7047, .adv_w = 256, .box_h = 12, .box_w = 16, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 7143, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7271, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7399, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 7497, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7609, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 7707, .adv_w = 160, .box_h = 16, .box_w = 10, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7787, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7899, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8011, .adv_w = 288, .box_h = 12, .box_w = 18, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 8119, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8247, .adv_w = 192, .box_h = 16, .box_w = 12, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8343, .adv_w = 320, .box_h = 14, .box_w = 20, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 8483, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8583, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8683, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8783, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8883, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8983, .adv_w = 224, .box_h = 16, .box_w = 12, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 9079, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 9191, .adv_w = 320, .box_h = 12, .box_w = 20, .ofs_x = 0, .ofs_y = 0}
|
||||
{.bitmap_index = 5575, .adv_w = 224, .box_h = 14, .box_w = 10, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 5645, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 5757, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 5855, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 5953, .adv_w = 224, .box_h = 14, .box_w = 10, .ofs_x = 2, .ofs_y = -1},
|
||||
{.bitmap_index = 6023, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6121, .adv_w = 160, .box_h = 14, .box_w = 10, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6191, .adv_w = 160, .box_h = 14, .box_w = 10, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6261, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6359, .adv_w = 224, .box_h = 4, .box_w = 14, .ofs_x = 0, .ofs_y = 4},
|
||||
{.bitmap_index = 6387, .adv_w = 288, .box_h = 12, .box_w = 18, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 6495, .adv_w = 320, .box_h = 16, .box_w = 20, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 6655, .adv_w = 288, .box_h = 16, .box_w = 18, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 6799, .adv_w = 256, .box_h = 14, .box_w = 16, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 6911, .adv_w = 224, .box_h = 10, .box_w = 14, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 6981, .adv_w = 224, .box_h = 10, .box_w = 14, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 7051, .adv_w = 320, .box_h = 12, .box_w = 20, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 7171, .adv_w = 256, .box_h = 12, .box_w = 16, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 7267, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7395, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7523, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 7621, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7733, .adv_w = 224, .box_h = 14, .box_w = 14, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 7831, .adv_w = 160, .box_h = 16, .box_w = 10, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 7911, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8023, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8135, .adv_w = 288, .box_h = 12, .box_w = 18, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 8243, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8371, .adv_w = 192, .box_h = 16, .box_w = 12, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 8467, .adv_w = 320, .box_h = 14, .box_w = 20, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 8607, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8707, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8807, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 8907, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 9007, .adv_w = 320, .box_h = 10, .box_w = 20, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 9107, .adv_w = 320, .box_h = 13, .box_w = 20, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 9237, .adv_w = 224, .box_h = 16, .box_w = 12, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 9333, .adv_w = 224, .box_h = 16, .box_w = 14, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 9445, .adv_w = 256, .box_h = 16, .box_w = 16, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 9573, .adv_w = 320, .box_h = 12, .box_w = 20, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 9693, .adv_w = 192, .box_h = 16, .box_w = 12, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 9789, .adv_w = 258, .box_h = 10, .box_w = 16, .ofs_x = 0, .ofs_y = 1}
|
||||
};
|
||||
|
||||
/*---------------------
|
||||
@ -1684,12 +1770,13 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
|
||||
static const uint16_t unicode_list_1[] = {
|
||||
0x0, 0x7, 0xa, 0xb, 0xc, 0x10, 0x12, 0x14,
|
||||
0x18, 0x1b, 0x20, 0x25, 0x26, 0x27, 0x3d, 0x43,
|
||||
0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x51, 0x52, 0x53,
|
||||
0x66, 0x67, 0x70, 0x73, 0x76, 0x77, 0x78, 0x7a,
|
||||
0x92, 0x94, 0xc3, 0xc4, 0xc6, 0xe6, 0xe9, 0xf2,
|
||||
0x11b, 0x123, 0x15a, 0x1ea, 0x23f, 0x240, 0x241, 0x242,
|
||||
0x243, 0x292, 0x2ec, 0x559
|
||||
0x18, 0x1b, 0x20, 0x25, 0x26, 0x27, 0x3d, 0x47,
|
||||
0x4a, 0x4b, 0x4c, 0x50, 0x51, 0x52, 0x53, 0x66,
|
||||
0x67, 0x6d, 0x6f, 0x70, 0x73, 0x76, 0x77, 0x78,
|
||||
0x7a, 0x92, 0x94, 0xc3, 0xc4, 0xc6, 0xe6, 0xe9,
|
||||
0xf2, 0x11b, 0x123, 0x15a, 0x1ea, 0x23f, 0x240, 0x241,
|
||||
0x242, 0x243, 0x286, 0x292, 0x2ec, 0x303, 0x559, 0x7c1,
|
||||
0x8a1
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
@ -1700,8 +1787,8 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
.glyph_id_start = 1, .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0
|
||||
},
|
||||
{
|
||||
.range_start = 61441, .range_length = 1370, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
|
||||
.glyph_id_start = 96, .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 52
|
||||
.range_start = 61441, .range_length = 2210, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
|
||||
.glyph_id_start = 96, .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 57
|
||||
}
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -12,12 +12,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* In the font converter use this list as range:
|
||||
61441, 61448, 61451, 61452, 61452, 61457, 61459, 61461, 61465, 61468,
|
||||
61473, 61478, 61479, 61480, 61502, 61508, 61512, 61515, 61516, 61517,
|
||||
61521, 61522, 61523, 61524, 61543, 61544, 61553, 61556, 61559, 61560,
|
||||
61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671, 61674, 61683,
|
||||
61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019, 62020, 62099,
|
||||
62189, 62810
|
||||
61441, 61448, 61451, 61452, 61452, 61453, 61457, 61459, 61461, 61465,
|
||||
61468, 61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517,
|
||||
61521, 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556,
|
||||
61559, 61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671,
|
||||
61674, 61683, 61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019,
|
||||
62020, 62087, 62099, 62212, 62189, 62810, 63426, 63650
|
||||
*/
|
||||
|
||||
#define LV_SYMBOL_AUDIO "\xef\x80\x81" /*61441, 0xF001*/
|
||||
@ -35,7 +35,7 @@ extern "C" {
|
||||
#define LV_SYMBOL_VOLUME_MID "\xef\x80\xa7" /*61479, 0xF027*/
|
||||
#define LV_SYMBOL_VOLUME_MAX "\xef\x80\xa8" /*61480, 0xF028*/
|
||||
#define LV_SYMBOL_IMAGE "\xef\x80\xbe" /*61502, 0xF03E*/
|
||||
#define LV_SYMBOL_EDIT "\xef\x81\x84" /*61508, 0xF044*/
|
||||
#define LV_SYMBOL_EDIT "\xef\x8C\x84" /*62212, 0xF304*/
|
||||
#define LV_SYMBOL_PREV "\xef\x81\x88" /*61512, 0xF048*/
|
||||
#define LV_SYMBOL_PLAY "\xef\x81\x8b" /*61515, 0xF04B*/
|
||||
#define LV_SYMBOL_PAUSE "\xef\x81\x8c" /*61516, 0xF04C*/
|
||||
@ -46,6 +46,8 @@ extern "C" {
|
||||
#define LV_SYMBOL_RIGHT "\xef\x81\x94" /*61524, 0xF054*/
|
||||
#define LV_SYMBOL_PLUS "\xef\x81\xa7" /*61543, 0xF067*/
|
||||
#define LV_SYMBOL_MINUS "\xef\x81\xa8" /*61544, 0xF068*/
|
||||
#define LV_SYMBOL_EYE_OPEN "\xef\x81\xae" /*61550, 0xF06E*/
|
||||
#define LV_SYMBOL_EYE_CLOSE "\xef\x81\xb0" /*61552, 0xF070*/
|
||||
#define LV_SYMBOL_WARNING "\xef\x81\xb1" /*61553, 0xF071*/
|
||||
#define LV_SYMBOL_SHUFFLE "\xef\x81\xb4" /*61556, 0xF074*/
|
||||
#define LV_SYMBOL_UP "\xef\x81\xb7" /*61559, 0xF077*/
|
||||
@ -69,9 +71,12 @@ extern "C" {
|
||||
#define LV_SYMBOL_BATTERY_2 "\xef\x89\x82" /*62018, 0xF242*/
|
||||
#define LV_SYMBOL_BATTERY_1 "\xef\x89\x83" /*62019, 0xF243*/
|
||||
#define LV_SYMBOL_BATTERY_EMPTY "\xef\x89\x84" /*62020, 0xF244*/
|
||||
#define LV_SYMBOL_USB "\xef\x8a\x87" /*62087, 0xF287*/
|
||||
#define LV_SYMBOL_BLUETOOTH "\xef\x8a\x93" /*62099, 0xF293*/
|
||||
#define LV_SYMBOL_TRASH "\xef\x8B\xAD" /*62189, 0xF2ED*/
|
||||
#define LV_SYMBOL_BACKSPACE "\xef\x95\x9A" /*62810, 0xF55A*/
|
||||
#define LV_SYMBOL_SD_CARD "\xef\x9F\x82" /*63426, 0xF7C2*/
|
||||
#define LV_SYMBOL_NEW_LINE "\xef\xA2\xA2" /*63650, 0xF8A2*/
|
||||
|
||||
/** Invalid symbol at (U+F8FF). If written before a string then `lv_img` will show it as a label*/
|
||||
#define LV_SYMBOL_DUMMY "\xEF\xA3\xBF"
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "../lv_core/lv_debug.h"
|
||||
#include "lv_imgbtn.h"
|
||||
#include "lv_label.h"
|
||||
|
||||
#if LV_USE_IMGBTN != 0
|
||||
|
||||
@ -142,6 +143,15 @@ void lv_imgbtn_set_src(lv_obj_t * imgbtn, lv_btn_state_t state, const void * src
|
||||
{
|
||||
LV_ASSERT_OBJ(imgbtn, LV_OBJX_NAME);
|
||||
|
||||
|
||||
if(lv_img_src_get_type(src_left) == LV_IMG_SRC_SYMBOL ||
|
||||
lv_img_src_get_type(src_mid) == LV_IMG_SRC_SYMBOL ||
|
||||
lv_img_src_get_type(src_right) == LV_IMG_SRC_SYMBOL )
|
||||
{
|
||||
LV_LOG_WARN("lv_imgbtn_set_src: symbols are not supported in tiled mode");
|
||||
return;
|
||||
}
|
||||
|
||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||
|
||||
ext->img_src_left[state] = src_left;
|
||||
@ -289,10 +299,21 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
|
||||
const lv_style_t * style = lv_imgbtn_get_style(imgbtn, state);
|
||||
lv_opa_t opa_scale = lv_obj_get_opa_scale(imgbtn);
|
||||
|
||||
|
||||
|
||||
#if LV_IMGBTN_TILED == 0
|
||||
const void * src = ext->img_src[state];
|
||||
lv_draw_img(&imgbtn->coords, clip_area, src, style, opa_scale);
|
||||
if(lv_img_src_get_type(src) == LV_IMG_SRC_SYMBOL) {
|
||||
lv_draw_label(&imgbtn->coords, clip_area, style, opa_scale, src, LV_TXT_FLAG_NONE, NULL, LV_LABEL_TEXT_SEL_OFF, LV_LABEL_TEXT_SEL_OFF, NULL);
|
||||
} else {
|
||||
lv_draw_img(&imgbtn->coords, clip_area, src, style, opa_scale);
|
||||
}
|
||||
#else
|
||||
if(lv_img_src_get_type(src) == LV_IMG_SRC_SYMBOL) {
|
||||
LV_LOG_WARN("lv_imgbtn_design: SYMBOLS are not supported in tiled mode")
|
||||
return;
|
||||
}
|
||||
|
||||
const void * src;
|
||||
lv_img_header_t header;
|
||||
lv_area_t coords;
|
||||
@ -388,8 +409,17 @@ static void refr_img(lv_obj_t * imgbtn)
|
||||
const void * src = ext->img_src_mid[state];
|
||||
#endif
|
||||
|
||||
lv_res_t info_res;
|
||||
info_res = lv_img_decoder_get_info(src, &header);
|
||||
lv_res_t info_res = LV_RES_OK;
|
||||
if(lv_img_src_get_type(src) == LV_IMG_SRC_SYMBOL) {
|
||||
const lv_style_t * style = ext->btn.styles[state];
|
||||
header.h = lv_font_get_line_height(style->text.font);
|
||||
header.w = lv_txt_get_width(src, strlen(src), style->text.font, style->text.letter_space, LV_TXT_FLAG_NONE);
|
||||
header.always_zero = 0;
|
||||
header.cf = LV_IMG_CF_ALPHA_1BIT;
|
||||
} else {
|
||||
info_res = lv_img_decoder_get_info(src, &header);
|
||||
}
|
||||
|
||||
if(info_res == LV_RES_OK) {
|
||||
ext->act_cf = header.cf;
|
||||
#if LV_IMGBTN_TILED == 0
|
||||
|
@ -36,7 +36,7 @@ static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param);
|
||||
static lv_signal_cb_t ancestor_signal;
|
||||
/* clang-format off */
|
||||
static const char * kb_map_lc[] = {"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", LV_SYMBOL_BACKSPACE, "\n",
|
||||
"ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", "Enter", "\n",
|
||||
"ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", LV_SYMBOL_NEW_LINE, "\n",
|
||||
"_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""};
|
||||
|
||||
@ -47,7 +47,7 @@ static const lv_btnm_ctrl_t kb_ctrl_lc_map[] = {
|
||||
LV_KB_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KB_CTRL_BTN_FLAGS | 2};
|
||||
|
||||
static const char * kb_map_uc[] = {"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", LV_SYMBOL_BACKSPACE, "\n",
|
||||
"abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", "Enter", "\n",
|
||||
"abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", LV_SYMBOL_NEW_LINE, "\n",
|
||||
"_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""};
|
||||
|
||||
@ -213,6 +213,9 @@ void lv_kb_set_mode(lv_obj_t * kb, lv_kb_mode_t mode)
|
||||
} else if(mode == LV_KB_MODE_NUM) {
|
||||
lv_btnm_set_map(kb, kb_map_num);
|
||||
lv_btnm_set_ctrl_map(kb, kb_ctrl_num_map);
|
||||
} else if(mode == LV_KB_MODE_TEXT_UPPER) {
|
||||
lv_btnm_set_map(kb, kb_map_uc);
|
||||
lv_btnm_set_ctrl_map(kb, kb_ctrl_uc_map);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ extern "C" {
|
||||
enum {
|
||||
LV_KB_MODE_TEXT,
|
||||
LV_KB_MODE_NUM,
|
||||
LV_KB_MODE_TEXT_UPPER,
|
||||
};
|
||||
typedef uint8_t lv_kb_mode_t;
|
||||
|
||||
|
@ -96,6 +96,8 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->title = lv_label_create(ext->header, NULL);
|
||||
lv_label_set_text(ext->title, "My title");
|
||||
|
||||
lv_obj_set_signal_cb(new_win, lv_win_signal);
|
||||
|
||||
/*Set the default styles*/
|
||||
lv_theme_t * th = lv_theme_get_current();
|
||||
if(th) {
|
||||
@ -110,8 +112,6 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT, &lv_style_transp);
|
||||
lv_win_set_style(new_win, LV_WIN_STYLE_HEADER, &lv_style_plain_color);
|
||||
}
|
||||
|
||||
lv_obj_set_signal_cb(new_win, lv_win_signal);
|
||||
}
|
||||
/*Copy an existing object*/
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user