merge beta

This commit is contained in:
Gabor Kiss-Vamosi
2018-04-17 14:39:27 +02:00
29 changed files with 192 additions and 80 deletions

View File

@@ -286,10 +286,10 @@ static bool lv_bar_design(lv_obj_t * bar, const lv_area_t * mask, lv_design_mode
if(w >= h) {
indic_area.x2 = (int32_t) ((int32_t)w * (ext->cur_value - ext->min_value)) / (ext->max_value - ext->min_value);
indic_area.x2 += indic_area.x1;
indic_area.x2 = indic_area.x1 + indic_area.x2 - 1;
} else {
indic_area.y1 = (int32_t) ((int32_t)h * (ext->cur_value - ext->min_value)) / (ext->max_value - ext->min_value);
indic_area.y1 = indic_area.y2 - indic_area.y1;
indic_area.y1 = indic_area.y2 - indic_area.y1 + 1;
}
/*Draw the indicator*/

View File

@@ -602,7 +602,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
break;
}
}
ext->btn_id_pr = area_below;
if(area_below < ext->btn_cnt) ext->btn_id_pr = area_below;
}
lv_obj_invalidate(btnm);
} else if(c == LV_GROUP_KEY_UP) {
@@ -611,10 +612,10 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
if(ext->btn_id_pr == LV_BTNM_PR_NONE) {
ext->btn_id_pr = 0;
} else {
uint16_t area_above;
int16_t area_above;
lv_coord_t pr_center = ext->button_areas[ext->btn_id_pr].x1 + (lv_area_get_width(&ext->button_areas[ext->btn_id_pr]) >> 1);
for(area_above = ext->btn_id_pr; area_above > 0; area_above --) {
for(area_above = ext->btn_id_pr; area_above >= 0; area_above --) {
if(ext->button_areas[area_above].y1 < ext->button_areas[ext->btn_id_pr].y1 &&
pr_center >= ext->button_areas[area_above].x1 - style->body.padding.hor &&
pr_center <= ext->button_areas[area_above].x2)
@@ -622,7 +623,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
break;
}
}
ext->btn_id_pr = area_above;
if(area_above >= 0) ext->btn_id_pr = area_above;
}
lv_obj_invalidate(btnm);

View File

@@ -135,7 +135,9 @@ void lv_cont_set_fit(lv_obj_t * cont, bool hor_en, bool ver_en)
ext->ver_fit = ver_en == false ? 0 : 1;
/*Send a signal to set a new size*/
cont->signal_func(cont, LV_SIGNAL_CORD_CHG, cont);
lv_area_t area;
lv_obj_get_coords(cont, &area);
cont->signal_func(cont, LV_SIGNAL_CORD_CHG, &area);
}
/*=====================

View File

@@ -36,8 +36,8 @@ typedef struct
/*New data for this type */
const void * src; /*Image source: Pointer to an array or a file or a symbol*/
lv_coord_t w; /*Width of the image (doubled when upscaled) (Handled by the library)*/
lv_coord_t h; /*Height of the image (doubled when upscaled) (Handled by the library)*/
lv_coord_t w; /*Width of the image (Handled by the library)*/
lv_coord_t h; /*Height of the image (Handled by the library)*/
uint8_t src_type :2; /*See: lv_img_src_t*/
uint8_t auto_size :1; /*1: automatically set the object size to the image size*/
uint8_t chroma_keyed :1; /*1: Chroma keyed image, LV_COLOR_TRANSP (lv_conf.h) pixels will be transparent (Handled by the library)*/
@@ -70,8 +70,8 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img);
/**
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0.
* Use 'lv_img_set_src()' instead.
* @param img
* @param fn
* @param img -
* @param fn -
*/
static inline void lv_img_set_file(lv_obj_t * img, const char * fn)
{
@@ -98,8 +98,8 @@ static inline void lv_img_set_style(lv_obj_t *img, lv_style_t *style)
/**
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
* @param img
* @param upscale
* @param img -
* @param upscale -
*/
static inline void lv_img_set_upscale(lv_obj_t * img, bool upcale)
{
@@ -147,7 +147,7 @@ static inline lv_style_t* lv_img_get_style(lv_obj_t *img)
/**
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
* @param img
* @param img -
* @return false
*/
static inline bool lv_img_get_upscale(lv_obj_t * img)

View File

@@ -387,14 +387,18 @@ static lv_res_t lv_app_kb_action(lv_obj_t * kb, const char * txt)
return LV_RES_OK;
}
else if(strcmp(txt, SYMBOL_CLOSE) == 0) {
lv_kb_set_ta(kb, NULL); /*De-assign the text area*/
if(ext->hide_action) ext->hide_action(kb);
else lv_obj_del(kb);
else {
lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/
lv_obj_del(kb);
}
return LV_RES_INV;
} else if(strcmp(txt, SYMBOL_OK) == 0) {
lv_kb_set_ta(kb, NULL); /*De-assign the text area*/
if(ext->ok_action) ext->ok_action(kb);
else lv_obj_del(kb);
else {
lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/
lv_obj_del(kb);
}
return LV_RES_INV;
}

View File

@@ -255,6 +255,11 @@ static lv_res_t lv_line_signal(lv_obj_t * line, lv_signal_t sign, void * param)
}
buf->type[i] = "lv_line";
}
else if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
lv_style_t * style = lv_line_get_style(line);
if(line->ext_size < style->line.width) line->ext_size = style->line.width;
}
return res;
}

View File

@@ -90,8 +90,8 @@ static inline void lv_line_set_style(lv_obj_t *line, lv_style_t *style)
/**
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
* @param line
* @param upscale
* @param line -
* @param upscale -
*/
static inline void lv_line_set_upscale(lv_obj_t * line, bool upcale)
{
@@ -127,7 +127,7 @@ static inline lv_style_t* lv_line_get_style(lv_obj_t *line)
/**
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
* @param line
* @param line -
* @return false
*/
static inline bool lv_line_get_upscale(lv_obj_t * line)

View File

@@ -80,7 +80,7 @@ void lv_lmeter_set_scale(lv_obj_t * lmeter, uint16_t angle, uint8_t line_cnt);
* Set the styles of a line meter
* @param lmeter pointer to a line meter object
* @param bg set the style of the line meter
* */
*/
static inline void lv_lmeter_set_style(lv_obj_t *lmeter, lv_style_t *bg)
{
lv_obj_set_style(lmeter, bg);

View File

@@ -348,6 +348,16 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
{
lv_res_t res;
/*Translate LV_GROUP_KEY_UP/DOWN to LV_GROUP_KEY_LEFT/RIGHT */
char c_trans = 0;
if(sign == LV_SIGNAL_CONTROLL) {
c_trans = *((char*)param);
if(c_trans == LV_GROUP_KEY_DOWN) c_trans = LV_GROUP_KEY_LEFT;
if(c_trans == LV_GROUP_KEY_UP) c_trans = LV_GROUP_KEY_RIGHT;
param = &c_trans;
}
/* Include the ancient signal function */
res = ancestor_signal(mbox, sign, param);
if(res != LV_RES_OK) return res;
@@ -356,7 +366,6 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
if(sign == LV_SIGNAL_CORD_CHG) {
if(lv_obj_get_width(mbox) != lv_area_get_width(param)) {
mbox_realign(mbox);
}
}
else if(sign == LV_SIGNAL_STYLE_CHG) {

View File

@@ -166,7 +166,7 @@ static inline void lv_page_set_scrl_layout(lv_obj_t * page, lv_layout_t layout)
* @param page pointer to a page object
* @param type which style should be set
* @param style pointer to a style
* */
*/
void lv_page_set_style(lv_obj_t *page, lv_page_style_t type, lv_style_t *style);
/*=====================
@@ -235,7 +235,7 @@ static inline bool lv_page_get_scrl_fit_ver(lv_obj_t * page)
* @param page pointer to page object
* @param type which style should be get
* @return style pointer to a style
* */
*/
lv_style_t * lv_page_get_style(lv_obj_t *page, lv_page_style_t type);
/*=====================

View File

@@ -309,11 +309,11 @@ static bool lv_slider_design(lv_obj_t * slider, const lv_area_t * mask, lv_desig
if(slider_w >= slider_h) {
area_indic.x2 = (int32_t) ((int32_t)lv_area_get_width(&area_indic) * (cur_value - min_value)) / (max_value - min_value);
area_indic.x2 += area_indic.x1;
area_indic.x2 = area_indic.x1 + area_indic.x2 - 1;
} else {
area_indic.y1 = (int32_t) ((int32_t)lv_area_get_height(&area_indic) * (cur_value - min_value)) / (max_value - min_value);
area_indic.y1 = area_indic.y2 - area_indic.y1;
area_indic.y1 = area_indic.y2 - area_indic.y1 + 1;
}
if(cur_value != min_value) lv_draw_rect(&area_indic, mask, style_indic);

View File

@@ -1044,7 +1044,10 @@ static void pwd_char_hider(lv_obj_t * ta)
int16_t len = lv_txt_get_length(txt);
bool refr = false;
uint16_t i;
for(i = 0; i < len; i++) txt[i] = '*';
for(i = 0; i < len; i++) {
txt[i] = '*';
refr = true;
}
txt[i] = '\0';