fix typo in the API

This commit is contained in:
Gabor Kiss-Vamosi
2020-06-16 12:03:32 +02:00
parent 00f8af0fb5
commit 4668bc0ee3
13 changed files with 91 additions and 87 deletions

View File

@@ -20,6 +20,8 @@
- Update `LV_OPA_MIN` and `LV_OPA_MAX` to widen the opacity processed range - Update `LV_OPA_MIN` and `LV_OPA_MAX` to widen the opacity processed range
- `lv_btnm` fix sending events for hidden buttons - `lv_btnm` fix sending events for hidden buttons
- `lv_gaguge` make `lv_gauge_set_angle_offset` offset the labels and needles too - `lv_gaguge` make `lv_gauge_set_angle_offset` offset the labels and needles too
- Fix typo in the API `scrllable` -> `scrollable`
- `tabview`: by default allow auto expanding the page only left and bottom directions. (#1573)
## v7.0.1 (01.06.2020) ## v7.0.1 (01.06.2020)

View File

@@ -172,7 +172,7 @@ static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page)
static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page) static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
{ {
return lv_page_get_scrllable(page); return lv_page_get_scrollable(page);
} }
#endif #endif

View File

@@ -925,6 +925,7 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
/*In navigation mode don't select any button but in edit mode select the fist*/ /*In navigation mode don't select any button but in edit mode select the fist*/
if(lv_group_get_editing(lv_obj_get_group(btnm))) { if(lv_group_get_editing(lv_obj_get_group(btnm))) {
ext->btn_id_focused = 0; ext->btn_id_focused = 0;
ext->btn_id_act = ext->btn_id_focused;
} }
else { else {
ext->btn_id_focused = LV_BTNMATRIX_BTN_NONE; ext->btn_id_focused = LV_BTNMATRIX_BTN_NONE;
@@ -932,9 +933,9 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
} }
else if(indev_type == LV_INDEV_TYPE_KEYPAD) { else if(indev_type == LV_INDEV_TYPE_KEYPAD) {
ext->btn_id_focused = 0; ext->btn_id_focused = 0;
ext->btn_id_act = ext->btn_id_focused;
} }
ext->btn_id_act = ext->btn_id_focused;
#endif #endif
} }
else if(sign == LV_SIGNAL_DEFOCUS || sign == LV_SIGNAL_LEAVE) { else if(sign == LV_SIGNAL_DEFOCUS || sign == LV_SIGNAL_LEAVE) {

View File

@@ -586,10 +586,10 @@ void lv_dropdown_open(lv_obj_t * ddlist)
ext->page = lv_page_create(lv_obj_get_screen(ddlist), NULL); ext->page = lv_page_create(lv_obj_get_screen(ddlist), NULL);
lv_obj_add_protect(ext->page, LV_PROTECT_POS | LV_PROTECT_CLICK_FOCUS); lv_obj_add_protect(ext->page, LV_PROTECT_POS | LV_PROTECT_CLICK_FOCUS);
lv_obj_add_protect(lv_page_get_scrllable(ext->page), LV_PROTECT_CLICK_FOCUS); lv_obj_add_protect(lv_page_get_scrollable(ext->page), LV_PROTECT_CLICK_FOCUS);
if(ancestor_page_signal == NULL) ancestor_page_signal = lv_obj_get_signal_cb(ext->page); if(ancestor_page_signal == NULL) ancestor_page_signal = lv_obj_get_signal_cb(ext->page);
if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable( if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrollable(
ext->page)); ext->page));
if(ancestor_page_design == NULL) ancestor_page_design = lv_obj_get_design_cb(ext->page); if(ancestor_page_design == NULL) ancestor_page_design = lv_obj_get_design_cb(ext->page);
@@ -604,7 +604,7 @@ void lv_dropdown_open(lv_obj_t * ddlist)
lv_obj_set_design_cb(ext->page, lv_dropdown_page_design); lv_obj_set_design_cb(ext->page, lv_dropdown_page_design);
lv_obj_set_signal_cb(ext->page, lv_dropdown_page_signal); lv_obj_set_signal_cb(ext->page, lv_dropdown_page_signal);
lv_obj_set_signal_cb(lv_page_get_scrllable(ext->page), lv_dropdown_page_scrl_signal); lv_obj_set_signal_cb(lv_page_get_scrollable(ext->page), lv_dropdown_page_scrl_signal);
lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_BG), &ext->style_page); lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_BG), &ext->style_page);
lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_SCROLLBAR), &ext->style_scrlbar); lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_SCROLLBAR), &ext->style_scrlbar);
@@ -1026,7 +1026,7 @@ static lv_res_t lv_dropdown_page_signal(lv_obj_t * page, lv_signal_t sign, void
* (The scrollabel is scrolled the "select rectangle" is drawn on the bg too)*/ * (The scrollabel is scrolled the "select rectangle" is drawn on the bg too)*/
lv_style_int_t left = lv_obj_get_style_pad_left(ddlist, LV_DROPDOWN_PART_LIST); lv_style_int_t left = lv_obj_get_style_pad_left(ddlist, LV_DROPDOWN_PART_LIST);
lv_style_int_t right = lv_obj_get_style_pad_right(ddlist, LV_DROPDOWN_PART_LIST); lv_style_int_t right = lv_obj_get_style_pad_right(ddlist, LV_DROPDOWN_PART_LIST);
lv_obj_t * scrl = lv_page_get_scrllable(page); lv_obj_t * scrl = lv_page_get_scrollable(page);
scrl->ext_draw_pad = LV_MATH_MAX3(scrl->ext_draw_pad, left, right); scrl->ext_draw_pad = LV_MATH_MAX3(scrl->ext_draw_pad, left, right);
} }
else if(sign == LV_SIGNAL_RELEASED) { else if(sign == LV_SIGNAL_RELEASED) {
@@ -1300,7 +1300,7 @@ static void position_to_selected(lv_obj_t * ddlist)
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_LIST); const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_LIST);
lv_coord_t font_h = lv_font_get_line_height(font); lv_coord_t font_h = lv_font_get_line_height(font);
lv_obj_t * scrl = lv_page_get_scrllable(ext->page); lv_obj_t * scrl = lv_page_get_scrollable(ext->page);
lv_obj_t * label = get_label(ddlist); lv_obj_t * label = get_label(ddlist);
if(label == NULL) return; if(label == NULL) return;
@@ -1320,7 +1320,7 @@ static lv_obj_t * get_label(const lv_obj_t * ddlist)
lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist); lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist);
if(ext->page == NULL) return NULL; if(ext->page == NULL) return NULL;
return lv_obj_get_child(lv_page_get_scrllable(ext->page), NULL); return lv_obj_get_child(lv_page_get_scrollable(ext->page), NULL);
} }
#endif #endif

View File

@@ -94,7 +94,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
/*Init the new list object*/ /*Init the new list object*/
if(copy == NULL) { if(copy == NULL) {
lv_page_set_anim_time(list, LV_LIST_DEF_ANIM_TIME); lv_page_set_anim_time(list, LV_LIST_DEF_ANIM_TIME);
lv_page_set_scrllable_fit2(list, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrollable_fit2(list, LV_FIT_PARENT, LV_FIT_TIGHT);
lv_obj_set_size(list, 2 * LV_DPI, 3 * LV_DPI); lv_obj_set_size(list, 2 * LV_DPI, 3 * LV_DPI);
lv_page_set_scrl_layout(list, LV_LIST_LAYOUT_DEF); lv_page_set_scrl_layout(list, LV_LIST_LAYOUT_DEF);
lv_list_set_scrollbar_mode(list, LV_SCROLLBAR_MODE_DRAG); lv_list_set_scrollbar_mode(list, LV_SCROLLBAR_MODE_DRAG);
@@ -131,7 +131,7 @@ void lv_list_clean(lv_obj_t * list)
{ {
LV_ASSERT_OBJ(list, LV_OBJX_NAME); LV_ASSERT_OBJ(list, LV_OBJX_NAME);
lv_obj_t * scrl = lv_page_get_scrllable(list); lv_obj_t * scrl = lv_page_get_scrollable(list);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@@ -155,7 +155,7 @@ lv_obj_t * lv_list_add_btn(lv_obj_t * list, const void * img_src, const char * t
lv_coord_t pos_x_ori = lv_obj_get_x(list); lv_coord_t pos_x_ori = lv_obj_get_x(list);
lv_coord_t pos_y_ori = lv_obj_get_y(list); lv_coord_t pos_y_ori = lv_obj_get_y(list);
lv_obj_t * scrl = lv_page_get_scrllable(list); lv_obj_t * scrl = lv_page_get_scrollable(list);
lv_obj_add_protect(scrl, LV_PROTECT_CHILD_CHG); lv_obj_add_protect(scrl, LV_PROTECT_CHILD_CHG);
/*Create a list element with the image an the text*/ /*Create a list element with the image an the text*/
@@ -328,10 +328,10 @@ void lv_list_set_layout(lv_obj_t * list, lv_layout_t layout)
} }
if(layout == LV_LAYOUT_COLUMN_MID || layout == LV_LAYOUT_COLUMN_LEFT || layout == LV_LAYOUT_COLUMN_RIGHT) { if(layout == LV_LAYOUT_COLUMN_MID || layout == LV_LAYOUT_COLUMN_LEFT || layout == LV_LAYOUT_COLUMN_RIGHT) {
lv_page_set_scrllable_fit2(list, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrollable_fit2(list, LV_FIT_PARENT, LV_FIT_TIGHT);
} }
else if(layout == LV_LAYOUT_ROW_MID || layout == LV_LAYOUT_ROW_TOP || layout == LV_LAYOUT_ROW_BOTTOM) { else if(layout == LV_LAYOUT_ROW_MID || layout == LV_LAYOUT_ROW_TOP || layout == LV_LAYOUT_ROW_BOTTOM) {
lv_page_set_scrllable_fit2(list, LV_FIT_TIGHT, LV_FIT_TIGHT); lv_page_set_scrollable_fit2(list, LV_FIT_TIGHT, LV_FIT_TIGHT);
lv_cont_set_fit2(list, LV_FIT_NONE, LV_FIT_TIGHT); lv_cont_set_fit2(list, LV_FIT_NONE, LV_FIT_TIGHT);
} }
@@ -414,7 +414,7 @@ lv_obj_t * lv_list_get_prev_btn(const lv_obj_t * list, lv_obj_t * prev_btn)
* When getting the next button try to be sure that it is at least a button */ * When getting the next button try to be sure that it is at least a button */
lv_obj_t * btn; lv_obj_t * btn;
lv_obj_t * scrl = lv_page_get_scrllable(list); lv_obj_t * scrl = lv_page_get_scrollable(list);
btn = lv_obj_get_child(scrl, prev_btn); btn = lv_obj_get_child(scrl, prev_btn);
if(btn == NULL) return NULL; if(btn == NULL) return NULL;
@@ -441,7 +441,7 @@ lv_obj_t * lv_list_get_next_btn(const lv_obj_t * list, lv_obj_t * prev_btn)
* When getting the next button try to be sure that it is at least a button */ * When getting the next button try to be sure that it is at least a button */
lv_obj_t * btn; lv_obj_t * btn;
lv_obj_t * scrl = lv_page_get_scrllable(list); lv_obj_t * scrl = lv_page_get_scrollable(list);
btn = lv_obj_get_child_back(scrl, prev_btn); btn = lv_obj_get_child_back(scrl, prev_btn);
if(btn == NULL) return NULL; if(btn == NULL) return NULL;
@@ -540,7 +540,7 @@ void lv_list_up(const lv_obj_t * list)
/*Search the first list element which 'y' coordinate is below the parent /*Search the first list element which 'y' coordinate is below the parent
* and position the list to show this element on the bottom*/ * and position the list to show this element on the bottom*/
lv_obj_t * scrl = lv_page_get_scrllable(list); lv_obj_t * scrl = lv_page_get_scrollable(list);
lv_obj_t * e; lv_obj_t * e;
lv_obj_t * e_prev = NULL; lv_obj_t * e_prev = NULL;
@@ -581,7 +581,7 @@ void lv_list_down(const lv_obj_t * list)
/*Search the first list element which 'y' coordinate is above the parent /*Search the first list element which 'y' coordinate is above the parent
* and position the list to show this element on the top*/ * and position the list to show this element on the top*/
lv_obj_t * scrl = lv_page_get_scrllable(list); lv_obj_t * scrl = lv_page_get_scrollable(list);
lv_obj_t * e; lv_obj_t * e;
e = lv_list_get_prev_btn(list, NULL); e = lv_list_get_prev_btn(list, NULL);
while(e != NULL) { while(e != NULL) {

View File

@@ -170,7 +170,7 @@ void lv_page_clean(lv_obj_t * page)
{ {
LV_ASSERT_OBJ(page, LV_OBJX_NAME); LV_ASSERT_OBJ(page, LV_OBJX_NAME);
lv_obj_t * scrl = lv_page_get_scrllable(page); lv_obj_t * scrl = lv_page_get_scrollable(page);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@@ -270,7 +270,7 @@ void lv_page_set_edge_flash(lv_obj_t * page, bool en)
* @param page pointer to a page object * @param page pointer to a page object
* @return pointer to a container which is the scrollable part of the page * @return pointer to a container which is the scrollable part of the page
*/ */
lv_obj_t * lv_page_get_scrllable(const lv_obj_t * page) lv_obj_t * lv_page_get_scrollable(const lv_obj_t * page)
{ {
LV_ASSERT_OBJ(page, LV_OBJX_NAME); LV_ASSERT_OBJ(page, LV_OBJX_NAME);
@@ -435,7 +435,7 @@ lv_coord_t lv_page_get_height_grid(lv_obj_t * page, uint8_t div, uint8_t span)
*/ */
bool lv_page_on_edge(lv_obj_t * page, lv_page_edge_t edge) bool lv_page_on_edge(lv_obj_t * page, lv_page_edge_t edge)
{ {
lv_obj_t * scrl = lv_page_get_scrllable(page); lv_obj_t * scrl = lv_page_get_scrollable(page);
lv_area_t page_coords; lv_area_t page_coords;
lv_area_t scrl_coords; lv_area_t scrl_coords;
@@ -571,7 +571,7 @@ void lv_page_focus(lv_obj_t * page, const lv_obj_t * obj, lv_anim_enable_t anim_
*/ */
void lv_page_scroll_hor(lv_obj_t * page, lv_coord_t dist) void lv_page_scroll_hor(lv_obj_t * page, lv_coord_t dist)
{ {
lv_obj_t * scrl = lv_page_get_scrllable(page); lv_obj_t * scrl = lv_page_get_scrollable(page);
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_anim_t a; lv_anim_t a;
@@ -593,7 +593,7 @@ void lv_page_scroll_hor(lv_obj_t * page, lv_coord_t dist)
*/ */
void lv_page_scroll_ver(lv_obj_t * page, lv_coord_t dist) void lv_page_scroll_ver(lv_obj_t * page, lv_coord_t dist)
{ {
lv_obj_t * scrl = lv_page_get_scrllable(page); lv_obj_t * scrl = lv_page_get_scrollable(page);
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_anim_t a; lv_anim_t a;
@@ -759,7 +759,7 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
} }
else if(sign == LV_SIGNAL_GET_STATE_DSC) { else if(sign == LV_SIGNAL_GET_STATE_DSC) {
lv_get_state_info_t * info = param; lv_get_state_info_t * info = param;
if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(page), if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrollable(page),
LV_CONT_PART_MAIN); LV_CONT_PART_MAIN);
else info->result = lv_obj_get_state(page, info->part); else info->result = lv_obj_get_state(page, info->part);
return LV_RES_OK; return LV_RES_OK;
@@ -806,7 +806,7 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
lv_obj_t * tmp = child; lv_obj_t * tmp = child;
child = lv_obj_get_child(page, child); /*Get the next child before move this*/ child = lv_obj_get_child(page, child); /*Get the next child before move this*/
/* Reposition the child to take padding into account (Only if it's on (0;0) or (widht;height) coordinates now) /* Reposition the child to take padding into account
* It's required to keep new the object on the same coordinate if FIT is enabled.*/ * It's required to keep new the object on the same coordinate if FIT is enabled.*/
if((tmp->coords.x1 == page->coords.x1) && if((tmp->coords.x1 == page->coords.x1) &&
(fit_left == LV_FIT_TIGHT || fit_left == LV_FIT_MAX) && (fit_left == LV_FIT_TIGHT || fit_left == LV_FIT_MAX) &&
@@ -970,7 +970,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
lv_page_ext_t * scroller_page_ext = lv_obj_get_ext_attr(scroller_page); lv_page_ext_t * scroller_page_ext = lv_obj_get_ext_attr(scroller_page);
page_ext->scroll_prop_obj = NULL; page_ext->scroll_prop_obj = NULL;
lv_obj_set_drag_parent(scroller_page, false); lv_obj_set_drag_parent(scroller_page, false);
lv_obj_set_drag_parent(lv_page_get_scrllable(scroller_page), false); lv_obj_set_drag_parent(lv_page_get_scrollable(scroller_page), false);
/*Hide scrollbars if required*/ /*Hide scrollbars if required*/
if(scroller_page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) { if(scroller_page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
@@ -1001,7 +1001,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
scroller_page = scroller_ext->scroll_prop_obj; scroller_page = scroller_ext->scroll_prop_obj;
scroller_ext->scroll_prop_obj = NULL; scroller_ext->scroll_prop_obj = NULL;
lv_obj_set_drag_parent(scroller_page, false); lv_obj_set_drag_parent(scroller_page, false);
lv_obj_set_drag_parent(lv_page_get_scrllable(scroller_page), false); lv_obj_set_drag_parent(lv_page_get_scrollable(scroller_page), false);
/*Hide scrollbars if required*/ /*Hide scrollbars if required*/
if(scroller_page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) { if(scroller_page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
@@ -1123,7 +1123,7 @@ static void scrl_reposition(lv_obj_t * page)
{ {
/*Limit the position of the scrollable object to be always visible /*Limit the position of the scrollable object to be always visible
* (Do not let its edge inner then its parent respective edge)*/ * (Do not let its edge inner then its parent respective edge)*/
lv_obj_t * scrl = lv_page_get_scrllable(page); lv_obj_t * scrl = lv_page_get_scrollable(page);
lv_coord_t new_x = lv_obj_get_x(scrl); lv_coord_t new_x = lv_obj_get_x(scrl);
lv_coord_t new_y = lv_obj_get_y(scrl); lv_coord_t new_y = lv_obj_get_y(scrl);
bool refr_x = false; bool refr_x = false;

View File

@@ -117,7 +117,7 @@ void lv_page_clean(lv_obj_t * page);
* @param page pointer to a page object * @param page pointer to a page object
* @return pointer to a container which is the scrollable part of the page * @return pointer to a container which is the scrollable part of the page
*/ */
lv_obj_t * lv_page_get_scrllable(const lv_obj_t * page); lv_obj_t * lv_page_get_scrollable(const lv_obj_t * page);
/** /**
* Get the animation time * Get the animation time
@@ -170,10 +170,10 @@ void lv_page_set_edge_flash(lv_obj_t * page, bool en);
* @param top bottom fit policy from `lv_fit_t` * @param top bottom fit policy from `lv_fit_t`
* @param bottom bottom fit policy from `lv_fit_t` * @param bottom bottom fit policy from `lv_fit_t`
*/ */
static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top, static inline void lv_page_set_scrollable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top,
lv_fit_t bottom) lv_fit_t bottom)
{ {
lv_cont_set_fit4(lv_page_get_scrllable(page), left, right, top, bottom); lv_cont_set_fit4(lv_page_get_scrollable(page), left, right, top, bottom);
} }
/** /**
@@ -183,9 +183,9 @@ static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv
* @param hot horizontal fit policy from `lv_fit_t` * @param hot horizontal fit policy from `lv_fit_t`
* @param ver vertical fit policy from `lv_fit_t` * @param ver vertical fit policy from `lv_fit_t`
*/ */
static inline void lv_page_set_scrllable_fit2(lv_obj_t * page, lv_fit_t hor, lv_fit_t ver) static inline void lv_page_set_scrollable_fit2(lv_obj_t * page, lv_fit_t hor, lv_fit_t ver)
{ {
lv_cont_set_fit2(lv_page_get_scrllable(page), hor, ver); lv_cont_set_fit2(lv_page_get_scrollable(page), hor, ver);
} }
/** /**
@@ -194,9 +194,9 @@ static inline void lv_page_set_scrllable_fit2(lv_obj_t * page, lv_fit_t hor, lv_
* @param page pointer to a button object * @param page pointer to a button object
* @param fit fit policy from `lv_fit_t` * @param fit fit policy from `lv_fit_t`
*/ */
static inline void lv_page_set_scrllable_fit(lv_obj_t * page, lv_fit_t fit) static inline void lv_page_set_scrollable_fit(lv_obj_t * page, lv_fit_t fit)
{ {
lv_cont_set_fit(lv_page_get_scrllable(page), fit); lv_cont_set_fit(lv_page_get_scrollable(page), fit);
} }
/** /**
@@ -206,7 +206,7 @@ static inline void lv_page_set_scrllable_fit(lv_obj_t * page, lv_fit_t fit)
*/ */
static inline void lv_page_set_scrl_width(lv_obj_t * page, lv_coord_t w) static inline void lv_page_set_scrl_width(lv_obj_t * page, lv_coord_t w)
{ {
lv_obj_set_width(lv_page_get_scrllable(page), w); lv_obj_set_width(lv_page_get_scrollable(page), w);
} }
/** /**
@@ -216,7 +216,7 @@ static inline void lv_page_set_scrl_width(lv_obj_t * page, lv_coord_t w)
*/ */
static inline void lv_page_set_scrl_height(lv_obj_t * page, lv_coord_t h) static inline void lv_page_set_scrl_height(lv_obj_t * page, lv_coord_t h)
{ {
lv_obj_set_height(lv_page_get_scrllable(page), h); lv_obj_set_height(lv_page_get_scrollable(page), h);
} }
/** /**
@@ -226,7 +226,7 @@ static inline void lv_page_set_scrl_height(lv_obj_t * page, lv_coord_t h)
*/ */
static inline void lv_page_set_scrl_layout(lv_obj_t * page, lv_layout_t layout) static inline void lv_page_set_scrl_layout(lv_obj_t * page, lv_layout_t layout)
{ {
lv_cont_set_layout(lv_page_get_scrllable(page), layout); lv_cont_set_layout(lv_page_get_scrollable(page), layout);
} }
/*===================== /*=====================
@@ -301,7 +301,7 @@ lv_coord_t lv_page_get_height_grid(lv_obj_t * page, uint8_t div, uint8_t span);
*/ */
static inline lv_coord_t lv_page_get_scrl_width(const lv_obj_t * page) static inline lv_coord_t lv_page_get_scrl_width(const lv_obj_t * page)
{ {
return lv_obj_get_width(lv_page_get_scrllable(page)); return lv_obj_get_width(lv_page_get_scrollable(page));
} }
/** /**
@@ -311,7 +311,7 @@ static inline lv_coord_t lv_page_get_scrl_width(const lv_obj_t * page)
*/ */
static inline lv_coord_t lv_page_get_scrl_height(const lv_obj_t * page) static inline lv_coord_t lv_page_get_scrl_height(const lv_obj_t * page)
{ {
return lv_obj_get_height(lv_page_get_scrllable(page)); return lv_obj_get_height(lv_page_get_scrollable(page));
} }
/** /**
@@ -321,7 +321,7 @@ static inline lv_coord_t lv_page_get_scrl_height(const lv_obj_t * page)
*/ */
static inline lv_layout_t lv_page_get_scrl_layout(const lv_obj_t * page) static inline lv_layout_t lv_page_get_scrl_layout(const lv_obj_t * page)
{ {
return lv_cont_get_layout(lv_page_get_scrllable(page)); return lv_cont_get_layout(lv_page_get_scrollable(page));
} }
/** /**
@@ -331,7 +331,7 @@ static inline lv_layout_t lv_page_get_scrl_layout(const lv_obj_t * page)
*/ */
static inline lv_fit_t lv_page_get_scrl_fit_left(const lv_obj_t * page) static inline lv_fit_t lv_page_get_scrl_fit_left(const lv_obj_t * page)
{ {
return lv_cont_get_fit_left(lv_page_get_scrllable(page)); return lv_cont_get_fit_left(lv_page_get_scrollable(page));
} }
/** /**
@@ -341,7 +341,7 @@ static inline lv_fit_t lv_page_get_scrl_fit_left(const lv_obj_t * page)
*/ */
static inline lv_fit_t lv_page_get_scrl_fit_right(const lv_obj_t * page) static inline lv_fit_t lv_page_get_scrl_fit_right(const lv_obj_t * page)
{ {
return lv_cont_get_fit_right(lv_page_get_scrllable(page)); return lv_cont_get_fit_right(lv_page_get_scrollable(page));
} }
/** /**
@@ -351,7 +351,7 @@ static inline lv_fit_t lv_page_get_scrl_fit_right(const lv_obj_t * page)
*/ */
static inline lv_fit_t lv_page_get_scrl_fit_top(const lv_obj_t * page) static inline lv_fit_t lv_page_get_scrl_fit_top(const lv_obj_t * page)
{ {
return lv_cont_get_fit_top(lv_page_get_scrllable(page)); return lv_cont_get_fit_top(lv_page_get_scrollable(page));
} }
/** /**
@@ -361,7 +361,7 @@ static inline lv_fit_t lv_page_get_scrl_fit_top(const lv_obj_t * page)
*/ */
static inline lv_fit_t lv_page_get_scrl_fit_bottom(const lv_obj_t * page) static inline lv_fit_t lv_page_get_scrl_fit_bottom(const lv_obj_t * page)
{ {
return lv_cont_get_fit_bottom(lv_page_get_scrllable(page)); return lv_cont_get_fit_bottom(lv_page_get_scrollable(page));
} }
/*===================== /*=====================

View File

@@ -76,7 +76,7 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
LV_ASSERT_MEM(roller); LV_ASSERT_MEM(roller);
if(roller == NULL) return NULL; if(roller == NULL) return NULL;
if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(roller)); if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrollable(roller));
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(roller); if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(roller);
/*Allocate the roller type specific extended data*/ /*Allocate the roller type specific extended data*/
@@ -104,9 +104,9 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
lv_obj_t * label = lv_label_create(roller, NULL); lv_obj_t * label = lv_label_create(roller, NULL);
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_t * scrl = lv_page_get_scrllable(roller); lv_obj_t * scrl = lv_page_get_scrollable(roller);
lv_obj_set_drag(scrl, true); lv_obj_set_drag(scrl, true);
lv_page_set_scrllable_fit2(roller, LV_FIT_PARENT, LV_FIT_NONE); /*Height is specified directly*/ lv_page_set_scrollable_fit2(roller, LV_FIT_PARENT, LV_FIT_NONE); /*Height is specified directly*/
lv_roller_set_anim_time(roller, LV_ROLLER_DEF_ANIM_TIME); lv_roller_set_anim_time(roller, LV_ROLLER_DEF_ANIM_TIME);
lv_roller_set_options(roller, "Option 1\nOption 2\nOption 3\nOption 4\nOption 5", LV_ROLLER_MODE_NORMAL); lv_roller_set_options(roller, "Option 1\nOption 2\nOption 3\nOption 4\nOption 5", LV_ROLLER_MODE_NORMAL);
@@ -123,7 +123,7 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
lv_roller_ext_t * copy_ext = lv_obj_get_ext_attr(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); lv_roller_set_options(roller, lv_roller_get_options(copy), copy_ext->mode);
ext->auto_fit = copy_ext->auto_fit; ext->auto_fit = copy_ext->auto_fit;
lv_obj_t * scrl = lv_page_get_scrllable(roller); lv_obj_t * scrl = lv_page_get_scrollable(roller);
lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal); lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);
} }
@@ -511,7 +511,7 @@ static lv_res_t lv_roller_signal(lv_obj_t * roller, lv_signal_t sign, void * par
if(lv_obj_get_width(roller) != lv_area_get_width(param) || if(lv_obj_get_width(roller) != lv_area_get_width(param) ||
lv_obj_get_height(roller) != lv_area_get_height(param)) { lv_obj_get_height(roller) != lv_area_get_height(param)) {
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_anim_del(lv_page_get_scrllable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); lv_anim_del(lv_page_get_scrollable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y);
#endif #endif
refr_position(roller, false); refr_position(roller, false);
refr_width(roller); refr_width(roller);
@@ -662,7 +662,7 @@ static lv_res_t lv_roller_scrl_signal(lv_obj_t * roller_scrl, lv_signal_t sign,
} }
else if(sign == LV_SIGNAL_PARENT_SIZE_CHG) { else if(sign == LV_SIGNAL_PARENT_SIZE_CHG) {
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_anim_del(lv_page_get_scrllable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); lv_anim_del(lv_page_get_scrollable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y);
#endif #endif
refr_position(roller, false); refr_position(roller, false);
refr_width(roller); refr_width(roller);
@@ -743,7 +743,7 @@ static void refr_position(lv_obj_t * roller, lv_anim_enable_t anim_en)
anim_en = LV_ANIM_OFF; anim_en = LV_ANIM_OFF;
#endif #endif
lv_obj_t * roller_scrl = lv_page_get_scrllable(roller); lv_obj_t * roller_scrl = lv_page_get_scrollable(roller);
lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller); lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);
const lv_font_t * font = lv_obj_get_style_text_font(roller, LV_ROLLER_PART_BG); const lv_font_t * font = lv_obj_get_style_text_font(roller, LV_ROLLER_PART_BG);
lv_style_int_t line_space = lv_obj_get_style_text_line_space(roller, LV_ROLLER_PART_BG); lv_style_int_t line_space = lv_obj_get_style_text_line_space(roller, LV_ROLLER_PART_BG);
@@ -878,10 +878,10 @@ static void refr_height(lv_obj_t * roller)
lv_obj_t * label = get_label(roller); lv_obj_t * label = get_label(roller);
if(label == NULL) return; if(label == NULL) return;
lv_obj_set_height(lv_page_get_scrllable(roller), lv_obj_get_height(label) + lv_obj_get_height(roller)); lv_obj_set_height(lv_page_get_scrollable(roller), lv_obj_get_height(label) + lv_obj_get_height(roller));
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_anim_del(lv_page_get_scrllable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); lv_anim_del(lv_page_get_scrollable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y);
#endif #endif
refr_position(roller, LV_ANIM_OFF); refr_position(roller, LV_ANIM_OFF);
} }
@@ -919,7 +919,7 @@ static void inf_normalize(void * scrl)
static lv_obj_t * get_label(const lv_obj_t * roller) static lv_obj_t * get_label(const lv_obj_t * roller)
{ {
lv_obj_t * scrl = lv_page_get_scrllable(roller); lv_obj_t * scrl = lv_page_get_scrollable(roller);
if(scrl == NULL) return NULL; /*The roller is being deleted, the scrollable already not exists*/ if(scrl == NULL) return NULL; /*The roller is being deleted, the scrollable already not exists*/
return lv_obj_get_child(scrl, NULL); return lv_obj_get_child(scrl, NULL);
} }

View File

@@ -89,7 +89,7 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy)
if(copy == NULL) { if(copy == NULL) {
/* No scrolling will happen here so make the scrollable non-clickable /* No scrolling will happen here so make the scrollable non-clickable
* It allows to handle input events in the bg object only.*/ * It allows to handle input events in the bg object only.*/
lv_obj_set_click(lv_page_get_scrllable(spinbox), false); lv_obj_set_click(lv_page_get_scrollable(spinbox), false);
lv_textarea_set_one_line(spinbox, true); lv_textarea_set_one_line(spinbox, true);
lv_textarea_set_cursor_click_pos(spinbox, true); lv_textarea_set_cursor_click_pos(spinbox, true);
lv_obj_set_width(spinbox, LV_DPI); lv_obj_set_width(spinbox, LV_DPI);

View File

@@ -129,16 +129,16 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
ext->btns = lv_btnmatrix_create(tabview, NULL); ext->btns = lv_btnmatrix_create(tabview, NULL);
ext->indic = lv_obj_create(ext->btns, NULL); ext->indic = lv_obj_create(ext->btns, NULL);
if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(ext->content)); if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrollable(ext->content));
lv_obj_set_signal_cb(lv_page_get_scrllable(ext->content), tabview_scrl_signal); lv_obj_set_signal_cb(lv_page_get_scrollable(ext->content), tabview_scrl_signal);
lv_btnmatrix_set_map(ext->btns, tab_def); lv_btnmatrix_set_map(ext->btns, tab_def);
lv_obj_set_event_cb(ext->btns, tab_btnm_event_cb); lv_obj_set_event_cb(ext->btns, tab_btnm_event_cb);
lv_obj_set_click(ext->indic, false); lv_obj_set_click(ext->indic, false);
lv_obj_set_drag_dir(lv_page_get_scrllable(ext->content), LV_DRAG_DIR_ONE); lv_obj_set_drag_dir(lv_page_get_scrollable(ext->content), LV_DRAG_DIR_ONE);
lv_page_set_scrllable_fit2(ext->content, LV_FIT_TIGHT, LV_FIT_PARENT); lv_page_set_scrollable_fit2(ext->content, LV_FIT_TIGHT, LV_FIT_PARENT);
lv_page_set_scrl_layout(ext->content, LV_LAYOUT_ROW_TOP); lv_page_set_scrl_layout(ext->content, LV_LAYOUT_ROW_TOP);
lv_page_set_scrollbar_mode(ext->content, LV_SCROLLBAR_MODE_OFF); lv_page_set_scrollbar_mode(ext->content, LV_SCROLLBAR_MODE_OFF);
@@ -216,6 +216,7 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * tabview, const char * name)
lv_obj_set_size(h, lv_obj_get_width(tabview), lv_obj_get_height(ext->content)); lv_obj_set_size(h, lv_obj_get_width(tabview), lv_obj_get_height(ext->content));
lv_page_set_scrollbar_mode(h, LV_SCROLLBAR_MODE_AUTO); lv_page_set_scrollbar_mode(h, LV_SCROLLBAR_MODE_AUTO);
lv_page_set_scroll_propagation(h, true); lv_page_set_scroll_propagation(h, true);
lv_page_set_scrollable_fit4(h, LV_FIT_NONE, LV_FIT_MAX, LV_FIT_NONE, LV_FIT_MAX);
lv_theme_apply(h, LV_THEME_TABVIEW_PAGE); lv_theme_apply(h, LV_THEME_TABVIEW_PAGE);
if(page_signal == NULL) page_signal = lv_obj_get_signal_cb(h); if(page_signal == NULL) page_signal = lv_obj_get_signal_cb(h);
@@ -306,7 +307,7 @@ void lv_tabview_clean_tab(lv_obj_t * tab)
{ {
LV_ASSERT_OBJ(tab, "lv_page"); LV_ASSERT_OBJ(tab, "lv_page");
lv_obj_t * scrl = lv_page_get_scrllable(tab); lv_obj_t * scrl = lv_page_get_scrollable(tab);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@@ -357,15 +358,15 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an
} }
if(anim == LV_ANIM_OFF || lv_tabview_get_anim_time(tabview) == 0) { if(anim == LV_ANIM_OFF || lv_tabview_get_anim_time(tabview) == 0) {
lv_obj_set_x(lv_page_get_scrllable(ext->content), cont_x); lv_obj_set_x(lv_page_get_scrollable(ext->content), cont_x);
} }
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
else { else {
lv_anim_t a; lv_anim_t a;
lv_anim_init(&a); lv_anim_init(&a);
lv_anim_set_var(&a, lv_page_get_scrllable(ext->content)); lv_anim_set_var(&a, lv_page_get_scrollable(ext->content));
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_x); lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_obj_set_x);
lv_anim_set_values(&a, lv_obj_get_x(lv_page_get_scrllable(ext->content)), cont_x); lv_anim_set_values(&a, lv_obj_get_x(lv_page_get_scrollable(ext->content)), cont_x);
lv_anim_set_time(&a, ext->anim_time); lv_anim_set_time(&a, ext->anim_time);
lv_anim_start(&a); lv_anim_start(&a);
} }
@@ -529,7 +530,7 @@ lv_obj_t * lv_tabview_get_tab(const lv_obj_t * tabview, uint16_t id)
LV_ASSERT_OBJ(tabview, LV_OBJX_NAME); LV_ASSERT_OBJ(tabview, LV_OBJX_NAME);
lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview); lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);
lv_obj_t * content_scrl = lv_page_get_scrllable(ext->content); lv_obj_t * content_scrl = lv_page_get_scrollable(ext->content);
uint16_t i = 0; uint16_t i = 0;
lv_obj_t * page = lv_obj_get_child_back(content_scrl, NULL); lv_obj_t * page = lv_obj_get_child_back(content_scrl, NULL);
@@ -967,7 +968,7 @@ static void refr_content_size(lv_obj_t * tabview)
lv_style_int_t bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_BG_SCRLLABLE); lv_style_int_t bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_style_int_t bg_bottom = lv_obj_get_style_pad_bottom(tabview, LV_TABVIEW_PART_BG_SCRLLABLE); lv_style_int_t bg_bottom = lv_obj_get_style_pad_bottom(tabview, LV_TABVIEW_PART_BG_SCRLLABLE);
cont_h -= bg_top + bg_bottom; cont_h -= bg_top + bg_bottom;
lv_obj_t * content_scrl = lv_page_get_scrllable(ext->content); lv_obj_t * content_scrl = lv_page_get_scrollable(ext->content);
lv_obj_t * pages = lv_obj_get_child(content_scrl, NULL); lv_obj_t * pages = lv_obj_get_child(content_scrl, NULL);
while(pages != NULL) { while(pages != NULL) {
/*Be sure adjust only the pages (user can other things)*/ /*Be sure adjust only the pages (user can other things)*/

View File

@@ -95,8 +95,8 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(ta); if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(ta);
if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(ta); if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(ta);
if(scrl_signal == NULL) scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(ta)); if(scrl_signal == NULL) scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrollable(ta));
if(scrl_design == NULL) scrl_design = lv_obj_get_design_cb(lv_page_get_scrllable(ta)); if(scrl_design == NULL) scrl_design = lv_obj_get_design_cb(lv_page_get_scrollable(ta));
/*Allocate the object type specific extended data*/ /*Allocate the object type specific extended data*/
lv_textarea_ext_t * ext = lv_obj_allocate_ext_attr(ta, sizeof(lv_textarea_ext_t)); lv_textarea_ext_t * ext = lv_obj_allocate_ext_attr(ta, sizeof(lv_textarea_ext_t));
@@ -133,12 +133,12 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
#endif #endif
lv_obj_set_signal_cb(ta, lv_textarea_signal); lv_obj_set_signal_cb(ta, lv_textarea_signal);
lv_obj_set_signal_cb(lv_page_get_scrllable(ta), lv_textarea_scrollable_signal); lv_obj_set_signal_cb(lv_page_get_scrollable(ta), lv_textarea_scrollable_signal);
lv_obj_set_design_cb(ta, lv_textarea_design); lv_obj_set_design_cb(ta, lv_textarea_design);
/*Init the new text area object*/ /*Init the new text area object*/
if(copy == NULL) { if(copy == NULL) {
lv_page_set_scrllable_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrollable_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT);
ext->label = lv_label_create(ta, NULL); ext->label = lv_label_create(ta, NULL);
@@ -764,20 +764,20 @@ void lv_textarea_set_one_line(lv_obj_t * ta, bool en)
lv_coord_t font_h = lv_font_get_line_height(font); lv_coord_t font_h = lv_font_get_line_height(font);
ext->one_line = 1; ext->one_line = 1;
lv_page_set_scrllable_fit2(ta, LV_FIT_MAX, LV_FIT_PARENT); lv_page_set_scrollable_fit2(ta, LV_FIT_MAX, LV_FIT_PARENT);
lv_obj_set_height(ta, font_h + top + bottom); lv_obj_set_height(ta, font_h + top + bottom);
lv_label_set_long_mode(ext->label, LV_LABEL_LONG_EXPAND); lv_label_set_long_mode(ext->label, LV_LABEL_LONG_EXPAND);
lv_obj_set_pos(lv_page_get_scrllable(ta), left, top); lv_obj_set_pos(lv_page_get_scrollable(ta), left, top);
} }
else { else {
lv_style_int_t top = lv_obj_get_style_pad_top(ta, LV_TEXTAREA_PART_BG); lv_style_int_t top = lv_obj_get_style_pad_top(ta, LV_TEXTAREA_PART_BG);
lv_style_int_t left = lv_obj_get_style_pad_left(ta, LV_TEXTAREA_PART_BG); lv_style_int_t left = lv_obj_get_style_pad_left(ta, LV_TEXTAREA_PART_BG);
ext->one_line = 0; ext->one_line = 0;
lv_page_set_scrllable_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrollable_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT);
lv_label_set_long_mode(ext->label, LV_LABEL_LONG_BREAK); lv_label_set_long_mode(ext->label, LV_LABEL_LONG_BREAK);
lv_obj_set_height(ta, LV_TEXTAREA_DEF_HEIGHT); lv_obj_set_height(ta, LV_TEXTAREA_DEF_HEIGHT);
lv_obj_set_pos(lv_page_get_scrllable(ta), left, top); lv_obj_set_pos(lv_page_get_scrollable(ta), left, top);
} }
/* `refr_cursor_area` is called at the end of lv_ta_set_text_align */ /* `refr_cursor_area` is called at the end of lv_ta_set_text_align */
@@ -804,7 +804,7 @@ void lv_textarea_set_text_align(lv_obj_t * ta, lv_label_align_t align)
/*Normal left align. Just let the text expand*/ /*Normal left align. Just let the text expand*/
if(align == LV_LABEL_ALIGN_LEFT) { if(align == LV_LABEL_ALIGN_LEFT) {
lv_label_set_long_mode(label, LV_LABEL_LONG_EXPAND); lv_label_set_long_mode(label, LV_LABEL_LONG_EXPAND);
lv_page_set_scrllable_fit2(ta, LV_FIT_MAX, LV_FIT_PARENT); lv_page_set_scrollable_fit2(ta, LV_FIT_MAX, LV_FIT_PARENT);
lv_label_set_align(label, align); lv_label_set_align(label, align);
} }
/*Else use fix label width equal to the Text area width*/ /*Else use fix label width equal to the Text area width*/
@@ -812,7 +812,7 @@ void lv_textarea_set_text_align(lv_obj_t * ta, lv_label_align_t align)
lv_label_set_long_mode(label, LV_LABEL_LONG_CROP); lv_label_set_long_mode(label, LV_LABEL_LONG_CROP);
lv_obj_set_width(label, lv_page_get_width_fit(ta)); lv_obj_set_width(label, lv_page_get_width_fit(ta));
lv_label_set_align(label, align); lv_label_set_align(label, align);
lv_page_set_scrllable_fit2(ta, LV_FIT_PARENT, LV_FIT_PARENT); lv_page_set_scrollable_fit2(ta, LV_FIT_PARENT, LV_FIT_PARENT);
} }
} }
@@ -1842,7 +1842,7 @@ static void update_cursor_position_on_click(lv_obj_t * ta, lv_signal_t sign, lv_
ext->sel_start = char_id_at_click; ext->sel_start = char_id_at_click;
ext->sel_end = LV_LABEL_TEXT_SEL_OFF; ext->sel_end = LV_LABEL_TEXT_SEL_OFF;
ext->text_sel_in_prog = 1; ext->text_sel_in_prog = 1;
lv_obj_set_drag(lv_page_get_scrllable(ta), false); lv_obj_set_drag(lv_page_get_scrollable(ta), false);
} }
else if(ext->text_sel_in_prog && sign == LV_SIGNAL_PRESSING) { else if(ext->text_sel_in_prog && sign == LV_SIGNAL_PRESSING) {
/*Input device may be moving. Store the end position */ /*Input device may be moving. Store the end position */
@@ -1850,7 +1850,7 @@ static void update_cursor_position_on_click(lv_obj_t * ta, lv_signal_t sign, lv_
} }
else if(ext->text_sel_in_prog && (sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_RELEASED)) { else if(ext->text_sel_in_prog && (sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_RELEASED)) {
/*Input device is released. Check if anything was selected.*/ /*Input device is released. Check if anything was selected.*/
lv_obj_set_drag(lv_page_get_scrllable(ta), true); lv_obj_set_drag(lv_page_get_scrollable(ta), true);
} }
} }

View File

@@ -80,7 +80,7 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
} }
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_tileview); if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_tileview);
if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(new_tileview)); if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrollable(new_tileview));
if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_tileview); if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_tileview);
/*Initialize the allocated 'ext' */ /*Initialize the allocated 'ext' */
@@ -94,7 +94,7 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
/*The signal and design functions are not copied so set them here*/ /*The signal and design functions are not copied so set them here*/
lv_obj_set_signal_cb(new_tileview, lv_tileview_signal); lv_obj_set_signal_cb(new_tileview, lv_tileview_signal);
lv_obj_set_signal_cb(lv_page_get_scrllable(new_tileview), lv_tileview_scrl_signal); lv_obj_set_signal_cb(lv_page_get_scrollable(new_tileview), lv_tileview_scrl_signal);
/*Init the new tileview*/ /*Init the new tileview*/
if(copy == NULL) { if(copy == NULL) {
@@ -113,10 +113,10 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
} }
lv_obj_set_size(new_tileview, w, h); lv_obj_set_size(new_tileview, w, h);
lv_obj_set_drag_throw(lv_page_get_scrllable(new_tileview), true); lv_obj_set_drag_throw(lv_page_get_scrollable(new_tileview), true);
lv_obj_set_drag_dir(lv_page_get_scrllable(new_tileview), LV_DRAG_DIR_ONE); lv_obj_set_drag_dir(lv_page_get_scrollable(new_tileview), LV_DRAG_DIR_ONE);
lv_page_set_scrllable_fit(new_tileview, LV_FIT_MAX); lv_page_set_scrollable_fit(new_tileview, LV_FIT_MAX);
lv_obj_reset_style_list(new_tileview, LV_PAGE_PART_SCROLLABLE); lv_obj_reset_style_list(new_tileview, LV_PAGE_PART_SCROLLABLE);
lv_theme_apply(new_tileview, LV_THEME_TILEVIEW); lv_theme_apply(new_tileview, LV_THEME_TILEVIEW);
@@ -228,7 +228,7 @@ void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, l
lv_coord_t x_coord = -x * lv_obj_get_width(tileview); lv_coord_t x_coord = -x * lv_obj_get_width(tileview);
lv_coord_t y_coord = -y * lv_obj_get_height(tileview); lv_coord_t y_coord = -y * lv_obj_get_height(tileview);
lv_obj_t * scrl = lv_page_get_scrllable(tileview); lv_obj_t * scrl = lv_page_get_scrollable(tileview);
if(anim) { if(anim) {
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_coord_t x_act = lv_obj_get_x(scrl); lv_coord_t x_act = lv_obj_get_x(scrl);
@@ -400,7 +400,7 @@ static void drag_end_handler(lv_obj_t * tileview)
lv_indev_t * indev = lv_indev_get_act(); lv_indev_t * indev = lv_indev_get_act();
lv_point_t point_act; lv_point_t point_act;
lv_indev_get_point(indev, &point_act); lv_indev_get_point(indev, &point_act);
lv_obj_t * scrl = lv_page_get_scrllable(tileview); lv_obj_t * scrl = lv_page_get_scrollable(tileview);
lv_point_t p; lv_point_t p;
p.x = -(scrl->coords.x1 - lv_obj_get_width(tileview) / 2); p.x = -(scrl->coords.x1 - lv_obj_get_width(tileview) / 2);

View File

@@ -154,7 +154,7 @@ void lv_win_clean(lv_obj_t * win)
{ {
LV_ASSERT_OBJ(win, LV_OBJX_NAME); LV_ASSERT_OBJ(win, LV_OBJX_NAME);
lv_obj_t * scrl = lv_page_get_scrllable(win); lv_obj_t * scrl = lv_page_get_scrollable(win);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@@ -448,7 +448,7 @@ lv_coord_t lv_win_get_width(lv_obj_t * win)
LV_ASSERT_OBJ(win, LV_OBJX_NAME); LV_ASSERT_OBJ(win, LV_OBJX_NAME);
lv_win_ext_t * ext = lv_obj_get_ext_attr(win); lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
lv_obj_t * scrl = lv_page_get_scrllable(ext->page); lv_obj_t * scrl = lv_page_get_scrollable(ext->page);
lv_coord_t left = lv_obj_get_style_pad_left(win, LV_WIN_PART_BG); lv_coord_t left = lv_obj_get_style_pad_left(win, LV_WIN_PART_BG);
lv_coord_t right = lv_obj_get_style_pad_left(win, LV_WIN_PART_BG); lv_coord_t right = lv_obj_get_style_pad_left(win, LV_WIN_PART_BG);
@@ -547,7 +547,7 @@ static lv_res_t lv_win_signal(lv_obj_t * win, lv_signal_t sign, void * param)
else if(sign == LV_SIGNAL_GET_STATE_DSC) { else if(sign == LV_SIGNAL_GET_STATE_DSC) {
lv_win_ext_t * ext = lv_obj_get_ext_attr(win); lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
lv_get_state_info_t * info = param; lv_get_state_info_t * info = param;
if(info->part == LV_WIN_PART_CONTENT_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(ext->page), if(info->part == LV_WIN_PART_CONTENT_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrollable(ext->page),
LV_CONT_PART_MAIN); LV_CONT_PART_MAIN);
else if(info->part == LV_WIN_PART_SCROLLBAR) info->result = lv_obj_get_state(ext->page, LV_PAGE_PART_SCROLLBAR); else if(info->part == LV_WIN_PART_SCROLLBAR) info->result = lv_obj_get_state(ext->page, LV_PAGE_PART_SCROLLBAR);
else if(info->part == LV_WIN_PART_HEADER) info->result = lv_obj_get_state(ext->header, LV_OBJ_PART_MAIN); else if(info->part == LV_WIN_PART_HEADER) info->result = lv_obj_get_state(ext->header, LV_OBJ_PART_MAIN);