minor updates during tests
This commit is contained in:
@@ -244,8 +244,6 @@ static bool lv_bar_design(lv_obj_t * bar, const area_t * mask, lv_design_mode_t
|
||||
|
||||
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
|
||||
|
||||
|
||||
|
||||
lv_style_t * style_indic = lv_bar_get_style_indic(bar);
|
||||
area_t indic_area;
|
||||
area_cpy(&indic_area, &bar->cords);
|
||||
|
||||
@@ -396,7 +396,6 @@ static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_
|
||||
ancestor_design_f(btnm, mask, mode);
|
||||
|
||||
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
|
||||
lv_style_t * style = lv_obj_get_style(btnm);
|
||||
lv_style_t * btn_style;
|
||||
|
||||
area_t area_btnm;
|
||||
|
||||
@@ -76,7 +76,13 @@ void lv_cb_set_text(lv_obj_t * cb, const char * txt);
|
||||
*/
|
||||
const char * lv_cb_get_text(lv_obj_t * cb);
|
||||
|
||||
/**
|
||||
* Get the bullet (lv_btn) of a check box
|
||||
* @param cb pointer to check box object
|
||||
* @return pointer to the bullet of the check box (lv_btn)
|
||||
*/
|
||||
lv_obj_t * lv_cb_get_bullet(lv_obj_t * cb);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -139,7 +139,7 @@ bool lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param)
|
||||
* @param color color of the data line
|
||||
* @return pointer to the allocated data line (
|
||||
*/
|
||||
lv_chart_dl_t * lv_chart_add_dataline(lv_obj_t * chart, color_t color)
|
||||
lv_chart_dl_t * lv_chart_add_data_line(lv_obj_t * chart, color_t color)
|
||||
{
|
||||
lv_chart_ext_t * ext = lv_obj_get_ext(chart);
|
||||
lv_chart_dl_t * dl = ll_ins_head(&ext->dl_ll);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_CHART_DL_NUM 8 /*Max data line number. Used in the style.*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@@ -83,7 +82,7 @@ bool lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param);
|
||||
* @param color color of the data line
|
||||
* @return pointer to the allocated data line (
|
||||
*/
|
||||
lv_chart_dl_t * lv_chart_add_dataline(lv_obj_t * chart, color_t color);
|
||||
lv_chart_dl_t * lv_chart_add_data_line(lv_obj_t * chart, color_t color);
|
||||
|
||||
/**
|
||||
* Refresh a chart if its data line has changed
|
||||
|
||||
@@ -30,9 +30,9 @@ typedef enum
|
||||
LV_CONT_LAYOUT_COL_L, /*Column left align*/
|
||||
LV_CONT_LAYOUT_COL_M, /*Column middle align*/
|
||||
LV_CONT_LAYOUT_COL_R, /*Column right align*/
|
||||
LV_CONT_LAYOUT_ROW_T, /*Row left align*/
|
||||
LV_CONT_LAYOUT_ROW_T, /*Row top align*/
|
||||
LV_CONT_LAYOUT_ROW_M, /*Row middle align*/
|
||||
LV_CONT_LAYOUT_ROW_B, /*Row right align*/
|
||||
LV_CONT_LAYOUT_ROW_B, /*Row bottom align*/
|
||||
LV_CONT_LAYOUT_PRETTY, /*Put as many object as possible in row and begin a new row*/
|
||||
LV_CONT_LAYOUT_GRID, /*Align same-sized object into a grid*/
|
||||
}lv_cont_layout_t;
|
||||
|
||||
@@ -36,8 +36,7 @@ static void lv_ddlist_pos_act_option(lv_obj_t * ddlist);
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_design_f_t ancestor_design_f;
|
||||
static const char * def_options[] = {"Option 1", "Option 2", "Option 3","Option 4", "Option 5", "Option 6",
|
||||
"Option 7", "Option 8", "Option 9","Option 10", "Option 11", "Option 12",""};
|
||||
static const char * def_options[] = {"Option 1", "Option 2", "Option 3", ""};
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
@@ -87,7 +86,6 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy)
|
||||
lv_obj_set_style(scrl, lv_style_get(LV_STYLE_TRANSP, NULL));
|
||||
|
||||
ext->opt_label = lv_label_create(new_ddlist, NULL);
|
||||
lv_obj_set_style(ext->opt_label, lv_style_get(LV_STYLE_PRETTY, NULL));
|
||||
lv_cont_set_fit(new_ddlist, true, false);
|
||||
lv_page_set_rel_action(new_ddlist, lv_ddlist_rel_action);
|
||||
lv_page_set_sb_mode(new_ddlist, LV_PAGE_SB_MODE_DRAG);
|
||||
@@ -258,7 +256,7 @@ bool lv_ddlist_get_auto_size(lv_obj_t * ddlist, bool auto_size)
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @return pointer the style of the select rectangle
|
||||
*/
|
||||
lv_style_t * lv_dlist_get_style_select(lv_obj_t * ddlist)
|
||||
lv_style_t * lv_ddlist_get_style_select(lv_obj_t * ddlist)
|
||||
{
|
||||
lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist);
|
||||
if(ext->style_sel == NULL) return lv_obj_get_style(ddlist);
|
||||
|
||||
@@ -132,7 +132,7 @@ bool lv_ddlist_get_auto_size(lv_obj_t * ddlist, bool auto_size);
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @return pointer the style of the select rectangle
|
||||
*/
|
||||
lv_style_t * lv_dlist_get_style_select(lv_obj_t * ddlist);
|
||||
lv_style_t * lv_ddlist_get_style_select(lv_obj_t * ddlist);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
@@ -189,6 +189,9 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle, int16_t value)
|
||||
|
||||
ext->values[needle] = value;
|
||||
|
||||
/*To be consistent with bar set the first needle's value for the bar*/
|
||||
if(needle == 0) lv_bar_set_value(gauge, value);
|
||||
|
||||
lv_obj_inv(gauge);
|
||||
}
|
||||
|
||||
@@ -309,6 +312,11 @@ static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mod
|
||||
int16_t min = lv_bar_get_min_value(gauge);
|
||||
int16_t max = lv_bar_get_max_value(gauge);
|
||||
|
||||
/*To be consistent with bar use the bar value as the first needle*/
|
||||
if(ext->needle_num != 0) {
|
||||
ext->values[0] = lv_bar_get_value(gauge);
|
||||
}
|
||||
|
||||
int16_t critical_val = ext->low_critical == 0 ? min : max;
|
||||
uint8_t i;
|
||||
|
||||
@@ -327,7 +335,8 @@ static bool lv_gauge_design(lv_obj_t * gauge, const area_t * mask, lv_design_mod
|
||||
style_bg.gcolor = color_mix(style_critical->gcolor, style_base->gcolor, ratio);
|
||||
style_bg.bcolor = color_mix(style_critical->bcolor, style_base->bcolor, ratio);
|
||||
style_bg.scolor = color_mix(style_critical->scolor, style_base->scolor, ratio);
|
||||
style_bg.swidth = (cord_t)((cord_t)(style_critical->swidth + style_base->swidth) * ratio) >> 8;
|
||||
style_bg.swidth = (cord_t)(((cord_t)style_critical->swidth * ratio) + ((cord_t)style_base->swidth * (OPA_COVER - ratio))) >> 8;
|
||||
style_bg.opa = (cord_t)(((uint16_t)style_critical->opa * ratio) + ((uint16_t)style_base->opa * (OPA_COVER - ratio))) >> 8;
|
||||
|
||||
lv_draw_rect(&gauge->cords, mask, &style_bg);
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy)
|
||||
ext->h = lv_obj_get_height(new_img);
|
||||
ext->transp = 0;
|
||||
ext->upscale = 0;
|
||||
ext->auto_size = 1;
|
||||
|
||||
/*Init the new object*/
|
||||
lv_obj_set_signal_f(new_img, lv_img_signal);
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
typedef enum
|
||||
{
|
||||
LV_LABEL_LONG_EXPAND, /*Expand the object size to the text size*/
|
||||
LV_LABEL_LONG_BREAK, /*Keep the width and break the text and expand the object height*/
|
||||
LV_LABEL_LONG_DOTS, /*Keep the size, break the text and write dots in the last line*/
|
||||
LV_LABEL_LONG_BREAK, /*Keep the object width, break the too long lines and expand the object height*/
|
||||
LV_LABEL_LONG_DOTS, /*Keep the object size, break the text and write dots in the last line*/
|
||||
LV_LABEL_LONG_SCROLL, /*Expand the object size and scroll the text on the parent (move the label object)*/
|
||||
}lv_label_long_mode_t;
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ void lv_list_set_style_img(lv_obj_t * list, lv_style_t * style)
|
||||
* @param liste pointer to list element
|
||||
* @return pointer to the text
|
||||
*/
|
||||
const char * lv_list_element_get_txt(lv_obj_t * liste)
|
||||
const char * lv_list_get_element_text(lv_obj_t * liste)
|
||||
{
|
||||
/*The last child is the label*/
|
||||
lv_obj_t * label = lv_obj_get_child(liste, NULL);
|
||||
|
||||
@@ -108,8 +108,8 @@ void lv_list_set_sb_out(lv_obj_t * list, bool out);
|
||||
* @param ina pointer to a style for inactive state
|
||||
*/
|
||||
void lv_list_set_styles_btn(lv_obj_t * list, lv_style_t * rel, lv_style_t * pr,
|
||||
lv_style_t * trel, lv_style_t * tpr,
|
||||
lv_style_t * ina);
|
||||
lv_style_t * trel, lv_style_t * tpr,
|
||||
lv_style_t * ina);
|
||||
|
||||
/**
|
||||
* Set the styles of the list element image (typically to set symbol font)
|
||||
@@ -123,7 +123,7 @@ void lv_list_set_style_img(lv_obj_t * list, lv_style_t * style);
|
||||
* @param liste pointer to list element
|
||||
* @return pointer to the text
|
||||
*/
|
||||
const char * lv_list_element_get_txt(lv_obj_t * liste);
|
||||
const char * lv_list_get_element_text(lv_obj_t * liste);
|
||||
|
||||
/**
|
||||
* Get the scroll bar outside attribute
|
||||
|
||||
@@ -518,7 +518,7 @@ static bool lv_ta_scrling_design(lv_obj_t * scrling, const area_t * mask, lv_des
|
||||
/*Draw the cursor too*/
|
||||
lv_obj_t * ta = lv_obj_get_parent(scrling);
|
||||
lv_ta_ext_t * ta_ext = lv_obj_get_ext(ta);
|
||||
lv_style_t * ta_style = lv_obj_get_style(ta);
|
||||
lv_style_t * scrl_style = lv_obj_get_style(lv_page_get_scrl(ta));
|
||||
|
||||
if(ta_ext->cursor_show != 0 && ta_ext->cursor_state == 0) {
|
||||
uint16_t cur_pos = lv_ta_get_cursor_pos(ta);
|
||||
@@ -529,15 +529,15 @@ static bool lv_ta_scrling_design(lv_obj_t * scrling, const area_t * mask, lv_des
|
||||
lv_style_t * labels_p = lv_obj_get_style(ta_ext->label);
|
||||
cur_area.x1 = letter_pos.x + ta_ext->label->cords.x1;
|
||||
cur_area.y1 = letter_pos.y + ta_ext->label->cords.y1;
|
||||
cur_area.x2 = letter_pos.x + ta_ext->label->cords.x1 + LV_DOWNSCALE ;
|
||||
cur_area.x2 = letter_pos.x + ta_ext->label->cords.x1 + scrl_style->line_width ;
|
||||
cur_area.y2 = letter_pos.y + ta_ext->label->cords.y1 + (font_get_height(labels_p->font) >> FONT_ANTIALIAS);
|
||||
|
||||
lv_style_t cur_rects;
|
||||
lv_style_get(LV_STYLE_PLAIN, &cur_rects);
|
||||
cur_rects.radius = 0;
|
||||
cur_rects.bwidth = 0;
|
||||
cur_rects.mcolor = ta_style->ccolor;
|
||||
cur_rects.gcolor = ta_style->ccolor;
|
||||
cur_rects.mcolor = scrl_style->ccolor;
|
||||
cur_rects.gcolor = scrl_style->ccolor;
|
||||
lv_draw_rect(&cur_area, mask, &cur_rects);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ bool lv_win_signal(lv_obj_t * win, lv_signal_t sign, void * param)
|
||||
* @param rel_action a function pointer to call when the button is released
|
||||
* @return pointer to the created button object
|
||||
*/
|
||||
lv_obj_t * lv_win_add_ctrl_btn(lv_obj_t * win, const char * img_path, lv_action_t rel_action)
|
||||
lv_obj_t * lv_win_add_cbtn(lv_obj_t * win, const char * img_path, lv_action_t rel_action)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext(win);
|
||||
|
||||
@@ -235,7 +235,7 @@ lv_obj_t * lv_win_add_ctrl_btn(lv_obj_t * win, const char * img_path, lv_action_
|
||||
*/
|
||||
lv_action_res_t lv_win_close_action(lv_obj_t * btn, lv_dispi_t * dispi)
|
||||
{
|
||||
lv_obj_t * win = lv_win_get_from_ctrl_btn(btn);
|
||||
lv_obj_t * win = lv_win_get_from_cbtn(btn);
|
||||
|
||||
lv_obj_del(win);
|
||||
|
||||
@@ -269,12 +269,12 @@ void lv_win_set_cbtn_size(lv_obj_t * win, cord_t size)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the style of the window control buttons in a given state
|
||||
* Set the styles of the window control buttons in a given state
|
||||
* @param win pointer to a window object
|
||||
* @param rel spointer to the style in released state
|
||||
* @param pr pointer to the style in pressed state
|
||||
*/
|
||||
void lv_win_set_style_cbtn(lv_obj_t * win, lv_style_t * rel, lv_style_t * pr)
|
||||
void lv_win_set_styles_cbtn(lv_obj_t * win, lv_style_t * rel, lv_style_t * pr)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext(win);
|
||||
ext->style_cbtn_rel = rel;
|
||||
@@ -356,7 +356,7 @@ cord_t lv_win_get_width(lv_obj_t * win)
|
||||
* @param ctrl_btn pointer to a control button of a window
|
||||
* @return pointer to the window of 'ctrl_btn'
|
||||
*/
|
||||
lv_obj_t * lv_win_get_from_ctrl_btn(lv_obj_t * ctrl_btn)
|
||||
lv_obj_t * lv_win_get_from_cbtn(lv_obj_t * ctrl_btn)
|
||||
{
|
||||
lv_obj_t * ctrl_holder = lv_obj_get_parent(ctrl_btn);
|
||||
lv_obj_t * header = lv_obj_get_parent(ctrl_holder);
|
||||
|
||||
@@ -88,7 +88,7 @@ bool lv_win_signal(lv_obj_t * win, lv_signal_t sign, void * param);
|
||||
* @param rel_action a function pointer to call when the button is released
|
||||
* @return pointer to the created button object
|
||||
*/
|
||||
lv_obj_t * lv_win_add_ctrl_btn(lv_obj_t * win, const char * img_path, lv_action_t rel_action);
|
||||
lv_obj_t * lv_win_add_cbtn(lv_obj_t * win, const char * img_path, lv_action_t rel_action);
|
||||
|
||||
/**
|
||||
* A release action which can be assigned to a window control button to close it
|
||||
@@ -113,12 +113,12 @@ void lv_win_set_title(lv_obj_t * win, const char * title);
|
||||
void lv_win_set_cbtn_size(lv_obj_t * win, cord_t size);
|
||||
|
||||
/**
|
||||
* Set the style of the window control buttons in a given state
|
||||
* Set the styles of the window control buttons in a given state
|
||||
* @param win pointer to a window object
|
||||
* @param rel spointer to the style in released state
|
||||
* @param pr pointer to the style in pressed state
|
||||
*/
|
||||
void lv_win_set_style_cbtn(lv_obj_t * win, lv_style_t * rel, lv_style_t * pr);
|
||||
void lv_win_set_styles_cbtn(lv_obj_t * win, lv_style_t * rel, lv_style_t * pr);
|
||||
|
||||
/**
|
||||
* Get the title of a window
|
||||
@@ -158,10 +158,10 @@ cord_t lv_win_get_width(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.
|
||||
* @param ctrl_btn pointer to a control button of a window
|
||||
* @return pointer to the window of 'ctrl_btn'
|
||||
* @param cbtn pointer to a control button of a window
|
||||
* @return pointer to the window of 'cbtn'
|
||||
*/
|
||||
lv_obj_t * lv_win_get_from_ctrl_btn(lv_obj_t * ctrl_btn);
|
||||
lv_obj_t * lv_win_get_from_cbtn(lv_obj_t * cbtn);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
Reference in New Issue
Block a user