mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
merge beta
This commit is contained in:
commit
c2712963d6
@ -201,7 +201,12 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent,const lv_obj_t * copy)
|
|||||||
new_obj->ext_size = 0;
|
new_obj->ext_size = 0;
|
||||||
|
|
||||||
/*Set appearance*/
|
/*Set appearance*/
|
||||||
new_obj->style_p = &lv_style_plain_color;
|
lv_theme_t * th = lv_theme_get_current();
|
||||||
|
if(th) {
|
||||||
|
new_obj->style_p = th->panel;
|
||||||
|
} else {
|
||||||
|
new_obj->style_p = &lv_style_plain_color;
|
||||||
|
}
|
||||||
|
|
||||||
/*Set virtual functions*/
|
/*Set virtual functions*/
|
||||||
lv_obj_set_signal_func(new_obj, lv_obj_signal);
|
lv_obj_set_signal_func(new_obj, lv_obj_signal);
|
||||||
|
@ -145,12 +145,12 @@ void lv_style_init(void)
|
|||||||
lv_style_transp.glass = 1;
|
lv_style_transp.glass = 1;
|
||||||
lv_style_transp.body.border.width = 0;
|
lv_style_transp.body.border.width = 0;
|
||||||
|
|
||||||
/*Transparent tight style*/
|
/*Transparent fitting size*/
|
||||||
memcpy(&lv_style_transp_fit, &lv_style_transp, sizeof(lv_style_t));
|
memcpy(&lv_style_transp_fit, &lv_style_transp, sizeof(lv_style_t));
|
||||||
lv_style_transp_fit.body.padding.hor = 0;
|
lv_style_transp_fit.body.padding.hor = 0;
|
||||||
lv_style_transp_fit.body.padding.ver = 0;
|
lv_style_transp_fit.body.padding.ver = 0;
|
||||||
|
|
||||||
/*Transparent fitting size*/
|
/*Transparent tight style*/
|
||||||
memcpy(&lv_style_transp_tight, &lv_style_transp_fit, sizeof(lv_style_t));
|
memcpy(&lv_style_transp_tight, &lv_style_transp_fit, sizeof(lv_style_t));
|
||||||
lv_style_transp_tight.body.padding.inner = 0;
|
lv_style_transp_tight.body.padding.inner = 0;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
|
|||||||
/* Run all task from the highest to the lowest priority
|
/* Run all task from the highest to the lowest priority
|
||||||
* If a lower priority task is executed check task again from the highest priority
|
* If a lower priority task is executed check task again from the highest priority
|
||||||
* but on the priority of executed tasks don't run tasks before the executed*/
|
* but on the priority of executed tasks don't run tasks before the executed*/
|
||||||
lv_task_t * task_interruper = NULL;
|
lv_task_t * task_interrupter = NULL;
|
||||||
lv_task_t * next;
|
lv_task_t * next;
|
||||||
bool end_flag;
|
bool end_flag;
|
||||||
do {
|
do {
|
||||||
@ -86,8 +86,8 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Here is the interrupter task. Don't execute it again.*/
|
/*Here is the interrupter task. Don't execute it again.*/
|
||||||
if(act == task_interruper) {
|
if(act == task_interrupter) {
|
||||||
task_interruper = NULL; /*From this point only task after the interrupter comes, so the interrupter is not interesting anymore*/
|
task_interrupter = NULL; /*From this point only task after the interrupter comes, so the interrupter is not interesting anymore*/
|
||||||
act = next;
|
act = next;
|
||||||
continue; /*Load the next task*/
|
continue; /*Load the next task*/
|
||||||
}
|
}
|
||||||
@ -97,10 +97,10 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
|
|||||||
lv_task_exec(act);
|
lv_task_exec(act);
|
||||||
}
|
}
|
||||||
/*Tasks with higher priority then the interrupted shall be run in every case*/
|
/*Tasks with higher priority then the interrupted shall be run in every case*/
|
||||||
else if(task_interruper) {
|
else if(task_interrupter) {
|
||||||
if(act->prio > task_interruper->prio) {
|
if(act->prio > task_interrupter->prio) {
|
||||||
if(lv_task_exec(act)) {
|
if(lv_task_exec(act)) {
|
||||||
task_interruper = act; /*Check all tasks again from the highest priority */
|
task_interrupter = act; /*Check all tasks again from the highest priority */
|
||||||
end_flag = false;
|
end_flag = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void)
|
|||||||
* Just run the remaining tasks*/
|
* Just run the remaining tasks*/
|
||||||
else {
|
else {
|
||||||
if(lv_task_exec(act)) {
|
if(lv_task_exec(act)) {
|
||||||
task_interruper = act; /*Check all tasks again from the highest priority */
|
task_interrupter = act; /*Check all tasks again from the highest priority */
|
||||||
end_flag = false;
|
end_flag = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -236,8 +236,6 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length,
|
|||||||
|
|
||||||
width += lv_font_get_width(font, letter);
|
width += lv_font_get_width(font, letter);
|
||||||
width += letter_space;
|
width += letter_space;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
width -= letter_space; /*Trim the last letter space. Important if the text is center aligned */
|
width -= letter_space; /*Trim the last letter space. Important if the text is center aligned */
|
||||||
|
@ -52,8 +52,9 @@ typedef struct
|
|||||||
/*New data for this type */
|
/*New data for this type */
|
||||||
uint8_t layout :4; /*A layout from 'lv_cont_layout_t' enum*/
|
uint8_t layout :4; /*A layout from 'lv_cont_layout_t' enum*/
|
||||||
uint8_t hor_fit :1; /*1: Enable horizontal fit to involve all children*/
|
uint8_t hor_fit :1; /*1: Enable horizontal fit to involve all children*/
|
||||||
uint8_t ver_fit :1; /*1: Enable horizontal fir to involve all children*/
|
uint8_t ver_fit :1; /*1: Enable horizontal fit to involve all children*/
|
||||||
} lv_cont_ext_t;
|
}lv_cont_ext_t;
|
||||||
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
|
@ -512,8 +512,10 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos)
|
|||||||
/*Search the line of the index letter */;
|
/*Search the line of the index letter */;
|
||||||
while(txt[line_start] != '\0') {
|
while(txt[line_start] != '\0') {
|
||||||
new_line_start += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, max_w, flag);
|
new_line_start += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, max_w, flag);
|
||||||
if(pos->y <= y + letter_height) break; /*The line is found (stored in 'line_start')*/
|
|
||||||
y += letter_height + style->text.line_space;
|
if(pos->y <= y + letter_height) break; /*The line is found (stored in 'line_start')*/
|
||||||
|
y += letter_height + style->text.line_space;
|
||||||
|
|
||||||
line_start = new_line_start;
|
line_start = new_line_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user