minor renames and fixes
This commit is contained in:
@@ -1195,8 +1195,8 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
case LV_THEME_DROPDOWN:
|
||||
lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_BTN);
|
||||
list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_BTN);
|
||||
lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_MAIN);
|
||||
list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_MAIN);
|
||||
lv_style_list_add_style(list, &ddlist_btn);
|
||||
|
||||
lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_LIST);
|
||||
@@ -1378,8 +1378,8 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAIN);
|
||||
lv_style_list_add_style(list, &gauge_main);
|
||||
|
||||
lv_obj_clean_style_list(obj, LV_GAUGE_PART_STRONG);
|
||||
list = lv_obj_get_style_list(obj, LV_GAUGE_PART_STRONG);
|
||||
lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAJOR);
|
||||
list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAJOR);
|
||||
lv_style_list_add_style(list, &gauge_strong);
|
||||
|
||||
lv_obj_clean_style_list(obj, LV_GAUGE_PART_NEEDLE);
|
||||
|
||||
@@ -726,8 +726,8 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
case LV_THEME_DROPDOWN:
|
||||
lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_BTN);
|
||||
list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_BTN);
|
||||
lv_obj_clean_style_list(obj, LV_DROPDOWN_PART_MAIN);
|
||||
list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_MAIN);
|
||||
lv_style_list_add_style(list, &style_bg);
|
||||
lv_style_list_add_style(list, &style_btn);
|
||||
|
||||
@@ -922,8 +922,8 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
lv_style_list_add_style(list, &style_bg);
|
||||
lv_style_list_add_style(list, &style_round);
|
||||
|
||||
lv_obj_clean_style_list(obj, LV_GAUGE_PART_STRONG);
|
||||
list = lv_obj_get_style_list(obj, LV_GAUGE_PART_STRONG);
|
||||
lv_obj_clean_style_list(obj, LV_GAUGE_PART_MAJOR);
|
||||
list = lv_obj_get_style_list(obj, LV_GAUGE_PART_MAJOR);
|
||||
lv_style_list_add_style(list, &style_tick_line);
|
||||
|
||||
lv_obj_clean_style_list(obj, LV_GAUGE_PART_NEEDLE);
|
||||
|
||||
@@ -49,7 +49,9 @@ typedef struct {
|
||||
/** Checkbox styles. */
|
||||
enum {
|
||||
LV_CHECKBOX_PART_BG = LV_BTN_PART_MAIN, /**< Style of object background. */
|
||||
_LV_CHECKBOX_PART_VIRTUAL_LAST,
|
||||
LV_CHECKBOX_PART_BULLET = _LV_BTN_PART_REAL_LAST, /**< Style of box (released). */
|
||||
_LV_CHECKBOX_PART_REAL_LAST
|
||||
};
|
||||
typedef uint8_t lv_checkbox_style_t;
|
||||
|
||||
@@ -99,7 +101,7 @@ static inline void lv_checkbox_set_checked(lv_obj_t * cb, bool checked)
|
||||
* Make the check box inactive (disabled)
|
||||
* @param cb pointer to a check box object
|
||||
*/
|
||||
static inline void lv_checkbox_set_inactive(lv_obj_t * cb)
|
||||
static inline void lv_checkbox_set_disabled(lv_obj_t * cb)
|
||||
{
|
||||
lv_btn_set_state(cb, LV_BTN_STATE_DISABLED);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ lv_obj_t * lv_dropdown_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
LV_LOG_TRACE("drop down list create started");
|
||||
|
||||
/*Create the ancestor drop down list*/
|
||||
lv_obj_t * ddlist = lv_btn_create(par, copy);
|
||||
lv_obj_t * ddlist = lv_obj_create(par, copy);
|
||||
LV_ASSERT_MEM(ddlist);
|
||||
if(ddlist == NULL) return NULL;
|
||||
|
||||
@@ -116,7 +116,7 @@ lv_obj_t * lv_dropdown_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->pr_opt_id = LV_DROPDOWN_PR_NONE;
|
||||
ext->option_cnt = 0;
|
||||
ext->dir = LV_DROPDOWN_DIR_DOWN;
|
||||
ext->max_height = LV_DPI * 2;
|
||||
ext->max_height = (3 * lv_disp_get_ver_res(NULL)) / 4;
|
||||
ext->anim_time = LV_DROPDOWN_DEF_ANIM_TIME;
|
||||
lv_style_list_init(&ext->style_page);
|
||||
lv_style_list_init(&ext->style_scrlbar);
|
||||
@@ -326,10 +326,26 @@ void lv_dropdown_set_selected(lv_obj_t * ddlist, uint16_t sel_opt)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a fix height for the drop down list
|
||||
* If 0 then the opened ddlist will be auto. sized else the set height will be applied.
|
||||
* Set the direction of the a drop down list
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @param dir LV_DROPDOWN_DIR_LEF/RIGHT/TOP/BOTTOM
|
||||
*/
|
||||
void lv_dropdown_set_dir(lv_obj_t * ddlist, lv_dropdown_dir_t dir)
|
||||
{
|
||||
LV_ASSERT_OBJ(ddlist, LV_OBJX_NAME);
|
||||
|
||||
lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist);
|
||||
if(ext->dir == dir) return;
|
||||
|
||||
ext->dir = dir;
|
||||
|
||||
lv_obj_invalidate(ddlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the maximal height for the drop down list
|
||||
* @param ddlist pointer to a drop down list
|
||||
* @param h the height when the list is opened (0: auto size)
|
||||
* @param h the maximal height
|
||||
*/
|
||||
void lv_dropdown_set_max_height(lv_obj_t * ddlist, lv_coord_t h)
|
||||
{
|
||||
@@ -365,23 +381,6 @@ void lv_dropdown_set_symbol(lv_obj_t * ddlist, const char * symbol)
|
||||
lv_obj_invalidate(ddlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the direction of the a drop down list
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @param dir LV_DROPDOWN_DIR_LEF/RIGHT/TOP/BOTTOM
|
||||
*/
|
||||
void lv_dropdown_set_dir(lv_obj_t * ddlist, lv_dropdown_dir_t dir)
|
||||
{
|
||||
LV_ASSERT_OBJ(ddlist, LV_OBJX_NAME);
|
||||
|
||||
lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist);
|
||||
if(ext->dir == dir) return;
|
||||
|
||||
ext->dir = dir;
|
||||
|
||||
lv_obj_invalidate(ddlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the ddlist highlight the last selected option and display its text or not
|
||||
* @param ddlist pointer to a drop down list object
|
||||
@@ -695,13 +694,13 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c
|
||||
|
||||
lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist);
|
||||
|
||||
lv_style_int_t left = lv_obj_get_style_pad_left(ddlist, LV_DROPDOWN_PART_BTN);
|
||||
lv_style_int_t right = lv_obj_get_style_pad_right(ddlist, LV_DROPDOWN_PART_BTN);
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(ddlist, LV_DROPDOWN_PART_BTN);
|
||||
lv_style_int_t left = lv_obj_get_style_pad_left(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||
lv_style_int_t right = lv_obj_get_style_pad_right(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||
|
||||
lv_draw_label_dsc_t label_dsc;
|
||||
lv_draw_label_dsc_init(&label_dsc);
|
||||
lv_obj_init_draw_label_dsc(ddlist, LV_DROPDOWN_PART_BTN, &label_dsc);
|
||||
lv_obj_init_draw_label_dsc(ddlist, LV_DROPDOWN_PART_MAIN, &label_dsc);
|
||||
|
||||
lv_area_t txt_area;
|
||||
lv_point_t txt_size;
|
||||
@@ -915,9 +914,9 @@ static lv_res_t lv_dropdown_signal(lv_obj_t * ddlist, lv_signal_t sign, void * p
|
||||
if(ext->page) lv_dropdown_close(ddlist, LV_ANIM_OFF);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_STYLE_CHG) {
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(ddlist, LV_DROPDOWN_PART_BTN);
|
||||
lv_style_int_t bottom = lv_obj_get_style_pad_bottom(ddlist, LV_DROPDOWN_PART_BTN);
|
||||
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_BTN);
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||
lv_style_int_t bottom = lv_obj_get_style_pad_bottom(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||
lv_obj_set_height(ddlist, top + bottom + lv_font_get_line_height(font));
|
||||
|
||||
if(ext->page) lv_obj_refresh_style(ext->page);
|
||||
@@ -1060,7 +1059,7 @@ static lv_style_list_t * lv_dropdown_get_style(lv_obj_t * ddlist, uint8_t part)
|
||||
lv_style_list_t * style_dsc_p;
|
||||
|
||||
switch(part) {
|
||||
case LV_DROPDOWN_PART_BTN:
|
||||
case LV_DROPDOWN_PART_MAIN:
|
||||
style_dsc_p = &ddlist->style_list;
|
||||
break;
|
||||
case LV_DROPDOWN_PART_LIST:
|
||||
|
||||
@@ -26,7 +26,6 @@ extern "C" {
|
||||
#error "lv_ddlist: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) "
|
||||
#endif
|
||||
|
||||
#include "../lv_widgets/lv_btn.h"
|
||||
#include "../lv_widgets/lv_page.h"
|
||||
#include "../lv_widgets/lv_label.h"
|
||||
|
||||
@@ -50,7 +49,6 @@ typedef uint8_t lv_dropdown_dir_t;
|
||||
|
||||
/*Data of drop down list*/
|
||||
typedef struct {
|
||||
lv_btn_ext_t btn; /*Ext. of ancestor*/
|
||||
/*New data for this type */
|
||||
lv_obj_t * page; /*The dropped down list*/
|
||||
const char * text; /*Text to display on the ddlist's button*/
|
||||
@@ -71,8 +69,8 @@ typedef struct {
|
||||
} lv_dropdown_ext_t;
|
||||
|
||||
enum {
|
||||
LV_DROPDOWN_PART_BTN = LV_BTN_PART_MAIN,
|
||||
LV_DROPDOWN_PART_LIST = _LV_BTN_PART_REAL_LAST,
|
||||
LV_DROPDOWN_PART_MAIN = LV_OBJ_PART_MAIN,
|
||||
LV_DROPDOWN_PART_LIST = _LV_OBJ_PART_REAL_LAST,
|
||||
LV_DROPDOWN_PART_SCRLBAR,
|
||||
LV_DROPDOWN_PART_SELECTED,
|
||||
};
|
||||
@@ -131,11 +129,18 @@ void lv_dropdown_add_option(lv_obj_t * ddlist, const char * option, uint16_t pos
|
||||
*/
|
||||
void lv_dropdown_set_selected(lv_obj_t * ddlist, uint16_t sel_opt);
|
||||
|
||||
|
||||
/**
|
||||
* Set a maximum height for the drop down list
|
||||
* If 0 then the opened ddlist will be auto. sized else the set height will be applied.
|
||||
* Set the direction of the a drop down list
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @param dir LV_DROPDOWN_DIR_LEF/RIGHT/TOP/BOTTOM
|
||||
*/
|
||||
void lv_dropdown_set_dir(lv_obj_t * ddlist, lv_dropdown_dir_t dir);
|
||||
|
||||
/**
|
||||
* Set the maximal height for the drop down list
|
||||
* @param ddlist pointer to a drop down list
|
||||
* @param h the height when the list is opened (0: auto size)
|
||||
* @param h the maximal height
|
||||
*/
|
||||
void lv_dropdown_set_max_height(lv_obj_t * ddlist, lv_coord_t h);
|
||||
|
||||
@@ -147,14 +152,12 @@ void lv_dropdown_set_max_height(lv_obj_t * ddlist, lv_coord_t h);
|
||||
void lv_dropdown_set_symbol(lv_obj_t * ddlist, const char * symbol);
|
||||
|
||||
/**
|
||||
* Set the scroll bar mode of a drop down list
|
||||
* Set whether the ddlist highlight the last selected option and display its text or not
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @param sb_mode the new mode from 'lv_page_sb_mode_t' enum
|
||||
* @param show true/false
|
||||
*/
|
||||
static inline void lv_dropdown_set_sb_mode(lv_obj_t * ddlist, lv_sb_mode_t mode)
|
||||
{
|
||||
lv_page_set_sb_mode(ddlist, mode);
|
||||
}
|
||||
void lv_dropdown_set_show_selected(lv_obj_t * ddlist, bool show);
|
||||
|
||||
/**
|
||||
* Set the open/close animation time.
|
||||
* @param ddlist pointer to a drop down list
|
||||
@@ -165,20 +168,6 @@ static inline void lv_dropdown_set_anim_time(lv_obj_t * ddlist, uint16_t anim_ti
|
||||
lv_page_set_anim_time(ddlist, anim_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the direction of the a drop down list
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @param dir LV_DROPDOWN_DIR_LEF/RIGHT/TOP/BOTTOM
|
||||
*/
|
||||
void lv_dropdown_set_dir(lv_obj_t * ddlist, lv_dropdown_dir_t dir);
|
||||
|
||||
/**
|
||||
* Set whether the ddlist highlight the last selected option and display its text or not
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @param show true/false
|
||||
*/
|
||||
void lv_dropdown_set_show_selected(lv_obj_t * ddlist, bool show);
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
*====================*/
|
||||
@@ -247,16 +236,6 @@ lv_dropdown_dir_t lv_dropdown_get_dir(const lv_obj_t * ddlist);
|
||||
*/
|
||||
bool lv_dropdown_get_show_selected(lv_obj_t * ddlist);
|
||||
|
||||
/**
|
||||
* Get the scroll bar mode of a drop down list
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @return scrollbar mode from 'lv_page_sb_mode_t' enum
|
||||
*/
|
||||
static inline lv_sb_mode_t lv_dropdown_get_sb_mode(const lv_obj_t * ddlist)
|
||||
{
|
||||
return lv_page_get_sb_mode(ddlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the open/close animation time.
|
||||
* @param ddlist pointer to a drop down list
|
||||
@@ -267,13 +246,6 @@ static inline uint16_t lv_dropdown_get_anim_time(const lv_obj_t * ddlist)
|
||||
return lv_page_get_anim_time(ddlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the alignment of the labels in a drop down list
|
||||
* @param ddlist pointer to a drop down list object
|
||||
* @return alignment of labels
|
||||
*/
|
||||
lv_label_align_t lv_dropdown_get_align(const lv_obj_t * ddlist);
|
||||
|
||||
/*=====================
|
||||
* Other functions
|
||||
*====================*/
|
||||
|
||||
@@ -118,8 +118,9 @@ lv_obj_t * lv_gauge_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->values[i] = copy_ext->values[i];
|
||||
}
|
||||
ext->label_count = copy_ext->label_count;
|
||||
|
||||
/*Refresh the style with new signal function*/
|
||||
// lv_obj_refresh_style(new_gauge);
|
||||
lv_obj_refresh_style(new_gauge);
|
||||
}
|
||||
|
||||
LV_LOG_INFO("gauge created");
|
||||
@@ -358,7 +359,7 @@ static lv_design_res_t lv_gauge_design(lv_obj_t * gauge, const lv_area_t * clip_
|
||||
/*Add the strong lines*/
|
||||
uint16_t line_cnt_tmp = ext->lmeter.line_cnt;
|
||||
ext->lmeter.line_cnt = ext->label_count; /*Only to labels*/
|
||||
lv_linemeter_draw_scale(gauge, clip_area, LV_GAUGE_PART_STRONG);
|
||||
lv_linemeter_draw_scale(gauge, clip_area, LV_GAUGE_PART_MAJOR);
|
||||
ext->lmeter.line_cnt = line_cnt_tmp; /*Restore the parameters*/
|
||||
|
||||
lv_gauge_draw_needle(gauge, clip_area);
|
||||
@@ -398,7 +399,7 @@ static lv_res_t lv_gauge_signal(lv_obj_t * gauge, lv_signal_t sign, void * param
|
||||
lv_mem_free(ext->values);
|
||||
ext->values = NULL;
|
||||
lv_obj_clean_style_list(gauge, LV_GAUGE_PART_NEEDLE);
|
||||
lv_obj_clean_style_list(gauge, LV_GAUGE_PART_STRONG);
|
||||
lv_obj_clean_style_list(gauge, LV_GAUGE_PART_MAJOR);
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -420,7 +421,7 @@ static lv_style_list_t * lv_gauge_get_style(lv_obj_t * gauge, uint8_t part)
|
||||
case LV_GAUGE_PART_MAIN:
|
||||
style_dsc_p = &gauge->style_list;
|
||||
break;
|
||||
case LV_GAUGE_PART_STRONG:
|
||||
case LV_GAUGE_PART_MAJOR:
|
||||
style_dsc_p = &ext->style_strong;
|
||||
break;
|
||||
case LV_GAUGE_PART_NEEDLE:
|
||||
@@ -442,7 +443,7 @@ static void lv_gauge_draw_labels(lv_obj_t * gauge, const lv_area_t * mask)
|
||||
char scale_txt[16];
|
||||
|
||||
lv_gauge_ext_t * ext = lv_obj_get_ext_attr(gauge);
|
||||
lv_style_int_t scale_width = lv_obj_get_style_scale_width(gauge, LV_GAUGE_PART_STRONG);
|
||||
lv_style_int_t scale_width = lv_obj_get_style_scale_width(gauge, LV_GAUGE_PART_MAJOR);
|
||||
lv_style_int_t left = lv_obj_get_style_pad_left(gauge, LV_GAUGE_PART_MAIN);
|
||||
lv_style_int_t right = lv_obj_get_style_pad_right(gauge, LV_GAUGE_PART_MAIN);
|
||||
lv_style_int_t top = lv_obj_get_style_pad_top(gauge, LV_GAUGE_PART_MAIN);
|
||||
@@ -458,7 +459,7 @@ static void lv_gauge_draw_labels(lv_obj_t * gauge, const lv_area_t * mask)
|
||||
|
||||
lv_draw_label_dsc_t label_dsc;
|
||||
lv_draw_label_dsc_init(&label_dsc);
|
||||
lv_obj_init_draw_label_dsc(gauge, LV_GAUGE_PART_STRONG, &label_dsc);
|
||||
lv_obj_init_draw_label_dsc(gauge, LV_GAUGE_PART_MAJOR, &label_dsc);
|
||||
|
||||
uint8_t i;
|
||||
for(i = 0; i < label_num; i++) {
|
||||
@@ -564,7 +565,6 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * clip_area)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lv_draw_rect_dsc_t mid_dsc;
|
||||
lv_draw_rect_dsc_init(&mid_dsc);
|
||||
lv_obj_init_draw_rect_dsc(gauge, LV_GAUGE_PART_NEEDLE, &mid_dsc);
|
||||
|
||||
@@ -52,7 +52,7 @@ typedef struct {
|
||||
/*Styles*/
|
||||
enum {
|
||||
LV_GAUGE_PART_MAIN = LV_LINEMETER_PART_MAIN,
|
||||
LV_GAUGE_PART_STRONG = _LV_LINEMETER_PART_VIRTUAL_LAST,
|
||||
LV_GAUGE_PART_MAJOR = _LV_LINEMETER_PART_VIRTUAL_LAST,
|
||||
LV_GAUGE_PART_NEEDLE,
|
||||
_LV_GAUGE_PART_VIRTUAL_LAST = _LV_LINEMETER_PART_VIRTUAL_LAST,
|
||||
_LV_GAUGE_PART_REAL_LAST = _LV_LINEMETER_PART_REAL_LAST,
|
||||
@@ -123,6 +123,16 @@ static inline void lv_gauge_set_critical_value(lv_obj_t * gauge, int16_t value)
|
||||
*/
|
||||
void lv_gauge_set_scale(lv_obj_t * gauge, uint16_t angle, uint8_t line_cnt, uint8_t label_cnt);
|
||||
|
||||
/**
|
||||
* Set the set an offset for the gauge's angles to rotate it.
|
||||
* @param gauge pointer to a line meter object
|
||||
* @param angle angle offset (0..360), rotates clockwise
|
||||
*/
|
||||
static inline void lv_gauge_set_angle_offset(lv_obj_t * gauge, uint16_t angle)
|
||||
{
|
||||
lv_linemeter_set_angle_offset(gauge, angle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an image to display as needle(s).
|
||||
* The needle image should be horizontal and pointing to the right (`--->`).
|
||||
@@ -210,6 +220,16 @@ static inline uint16_t lv_gauge_get_scale_angle(const lv_obj_t * gauge)
|
||||
return lv_linemeter_get_scale_angle(gauge);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the offset for the gauge.
|
||||
* @param gauge pointer to a gauge object
|
||||
* @return angle offset (0..360)
|
||||
*/
|
||||
static inline uint16_t lv_gauge_get_angle_offset(lv_obj_t * gauge)
|
||||
{
|
||||
return lv_linemeter_get_angle_offset(gauge);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an image to display as needle(s).
|
||||
* @param gauge pointer to a gauge object
|
||||
|
||||
@@ -255,7 +255,7 @@ uint16_t lv_linemeter_get_scale_angle(const lv_obj_t * lmeter)
|
||||
}
|
||||
|
||||
/**
|
||||
* get the set an offset for the line meter.
|
||||
* Get the offset for the line meter.
|
||||
* @param lmeter pointer to a line meter object
|
||||
* @return angle offset (0..360)
|
||||
*/
|
||||
|
||||
@@ -133,7 +133,7 @@ uint16_t lv_linemeter_get_line_count(const lv_obj_t * lmeter);
|
||||
uint16_t lv_linemeter_get_scale_angle(const lv_obj_t * lmeter);
|
||||
|
||||
/**
|
||||
* get the set an offset for the line meter.
|
||||
* Get the offset for the line meter.
|
||||
* @param lmeter pointer to a line meter object
|
||||
* @return angle offset (0..360)
|
||||
*/
|
||||
|
||||
@@ -124,7 +124,7 @@ void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn);
|
||||
*/
|
||||
static inline void lv_list_set_sb_mode(lv_obj_t * list, lv_sb_mode_t mode)
|
||||
{
|
||||
lv_page_set_sb_mode(list, mode);
|
||||
lv_page_set_scrlbar_mode(list, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,7 +129,7 @@ lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_obj_set_signal_cb(page, lv_page_signal);
|
||||
lv_obj_set_design_cb(page, lv_page_design);
|
||||
|
||||
lv_page_set_sb_mode(page, ext->scrlbar.mode);
|
||||
lv_page_set_scrlbar_mode(page, ext->scrlbar.mode);
|
||||
|
||||
lv_theme_apply(page, LV_THEME_PAGE);
|
||||
|
||||
@@ -148,7 +148,7 @@ lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
// lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, lv_page_get_style(copy, LV_PAGE_STYLE_SCRL));
|
||||
// lv_page_set_style(new_page, LV_PAGE_STYLE_SCRLBAR, lv_page_get_style(copy, LV_PAGE_STYLE_SCRLBAR));
|
||||
|
||||
lv_page_set_sb_mode(page, copy_ext->scrlbar.mode);
|
||||
lv_page_set_scrlbar_mode(page, copy_ext->scrlbar.mode);
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ void lv_page_clean(lv_obj_t * page)
|
||||
* @param page pointer to a page object
|
||||
* @param sb_mode the new mode from 'lv_page_sb.mode_t' enum
|
||||
*/
|
||||
void lv_page_set_sb_mode(lv_obj_t * page, lv_sb_mode_t sb_mode)
|
||||
void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_sb_mode_t sb_mode)
|
||||
{
|
||||
LV_ASSERT_OBJ(page, LV_OBJX_NAME);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ uint16_t lv_page_get_anim_time(const lv_obj_t * page);
|
||||
* @param page pointer to a page object
|
||||
* @param sb_mode the new mode from 'lv_page_sb.mode_t' enum
|
||||
*/
|
||||
void lv_page_set_sb_mode(lv_obj_t * page, lv_sb_mode_t sb_mode);
|
||||
void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_sb_mode_t sb_mode);
|
||||
|
||||
/**
|
||||
* Set the animation time for the page
|
||||
|
||||
@@ -140,7 +140,7 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
|
||||
lv_page_set_scrl_fit2(ext->content, LV_FIT_TIGHT, LV_FIT_PARENT);
|
||||
lv_page_set_scrl_layout(ext->content, LV_LAYOUT_ROW_TOP);
|
||||
lv_page_set_sb_mode(ext->content, LV_SB_MODE_OFF);
|
||||
lv_page_set_scrlbar_mode(ext->content, LV_SB_MODE_OFF);
|
||||
|
||||
lv_obj_clean_style_list(ext->content, LV_PAGE_PART_BG);
|
||||
|
||||
@@ -226,7 +226,7 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * tabview, const char * name)
|
||||
/*Create the container page*/
|
||||
lv_obj_t * h = lv_page_create(ext->content, NULL);
|
||||
lv_obj_set_size(h, lv_obj_get_width(tabview), lv_obj_get_height(ext->content));
|
||||
lv_page_set_sb_mode(h, LV_SB_MODE_AUTO);
|
||||
lv_page_set_scrlbar_mode(h, LV_SB_MODE_AUTO);
|
||||
lv_page_set_scroll_propagation(h, true);
|
||||
lv_theme_apply(h, LV_THEME_TABVIEW_PAGE);
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ void lv_textarea_set_insert_replace(lv_obj_t * ta, const char * txt);
|
||||
*/
|
||||
static inline void lv_textarea_set_sb_mode(lv_obj_t * ta, lv_sb_mode_t mode)
|
||||
{
|
||||
lv_page_set_sb_mode(ta, mode);
|
||||
lv_page_set_scrlbar_mode(ta, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,7 +95,7 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
|
||||
ext->page = lv_page_create(new_win, NULL);
|
||||
lv_obj_add_protect(ext->page, LV_PROTECT_PARENT);
|
||||
lv_page_set_sb_mode(ext->page, LV_SB_MODE_AUTO);
|
||||
lv_page_set_scrlbar_mode(ext->page, LV_SB_MODE_AUTO);
|
||||
lv_obj_clean_style_list(ext->page, LV_PAGE_PART_BG);
|
||||
|
||||
/*Create a holder for the header*/
|
||||
@@ -277,7 +277,7 @@ void lv_win_set_sb_mode(lv_obj_t * win, lv_sb_mode_t sb_mode)
|
||||
LV_ASSERT_OBJ(win, LV_OBJX_NAME);
|
||||
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
lv_page_set_sb_mode(ext->page, sb_mode);
|
||||
lv_page_set_scrlbar_mode(ext->page, sb_mode);
|
||||
}
|
||||
/**
|
||||
* Set focus animation duration on `lv_win_focus()`
|
||||
|
||||
Reference in New Issue
Block a user