mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
Merge branch 'master' into dev
This commit is contained in:
commit
c7fb2ad12c
@ -534,6 +534,7 @@ static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni)
|
||||
*/
|
||||
static uint32_t lv_txt_utf8_conv_wc(uint32_t c)
|
||||
{
|
||||
#if LV_BIG_ENDIAN_SYSTEM == 0
|
||||
/*Swap the bytes (UTF-8 is big endian, but the MCUs are little endian)*/
|
||||
if((c & 0x80) != 0) {
|
||||
uint32_t swapped;
|
||||
@ -547,7 +548,7 @@ static uint32_t lv_txt_utf8_conv_wc(uint32_t c)
|
||||
}
|
||||
c = swapped;
|
||||
}
|
||||
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -171,6 +171,7 @@ void lv_objmask_remove_mask(lv_obj_t * objmask, lv_objmask_mask_t * mask)
|
||||
else {
|
||||
lv_mem_free(mask->param);
|
||||
_lv_ll_remove(&ext->mask_ll, mask);
|
||||
lv_mem_free(mask);
|
||||
}
|
||||
|
||||
lv_obj_invalidate(objmask);
|
||||
|
@ -123,11 +123,16 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
}
|
||||
/*Copy an existing roller*/
|
||||
else {
|
||||
lv_label_create(roller, get_label(copy));
|
||||
|
||||
lv_roller_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
|
||||
lv_roller_set_options(roller, lv_roller_get_options(copy), copy_ext->mode);
|
||||
ext->auto_fit = copy_ext->auto_fit;
|
||||
lv_obj_t * scrl = lv_page_get_scrollable(roller);
|
||||
lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);
|
||||
|
||||
lv_style_list_copy(&ext->style_sel, ©_ext->style_sel);
|
||||
lv_obj_refresh_style(roller, LV_STYLE_PROP_ALL);
|
||||
}
|
||||
|
||||
LV_LOG_INFO("roller created");
|
||||
|
@ -231,9 +231,17 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
|
||||
|
||||
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
|
||||
|
||||
uint32_t letter_buf[2];
|
||||
letter_buf[0] = c;
|
||||
letter_buf[1] = '\0';
|
||||
const char *letter_buf;
|
||||
|
||||
uint32_t u32_buf[2];
|
||||
u32_buf[0] = c;
|
||||
u32_buf[1] = 0;
|
||||
|
||||
letter_buf = (char*)&u32_buf;
|
||||
|
||||
#if LV_BIG_ENDIAN_SYSTEM
|
||||
if (c != 0) while (*letter_buf == 0) ++letter_buf;
|
||||
#endif
|
||||
|
||||
ta_insert_replace = NULL;
|
||||
lv_event_send(ta, LV_EVENT_INSERT, letter_buf);
|
||||
@ -241,7 +249,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
|
||||
if(ta_insert_replace[0] == '\0') return; /*Drop this text*/
|
||||
|
||||
/*Add the replaced text directly it's different from the original*/
|
||||
if(strcmp(ta_insert_replace, (char *)letter_buf)) {
|
||||
if(strcmp(ta_insert_replace, letter_buf)) {
|
||||
lv_textarea_add_text(ta, ta_insert_replace);
|
||||
return;
|
||||
}
|
||||
@ -272,7 +280,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
|
||||
if(txt[0] == '\0') lv_obj_invalidate(ta);
|
||||
}
|
||||
|
||||
lv_label_ins_text(ext->label, ext->cursor.pos, (const char *)letter_buf); /*Insert the character*/
|
||||
lv_label_ins_text(ext->label, ext->cursor.pos, letter_buf); /*Insert the character*/
|
||||
lv_textarea_clear_selection(ta); /*Clear selection*/
|
||||
|
||||
if(ext->pwd_mode != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user