1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

add LV_USE_API_EXTENSION_V6 and LV_USE_IMG_TRANSFORM config options

This commit is contained in:
Gabor Kiss-Vamosi 2020-05-12 21:29:16 +02:00
parent a1db29b9a2
commit a78687ee5d
27 changed files with 275 additions and 190 deletions

View File

@ -169,6 +169,9 @@ typedef void * lv_anim_user_data_t;
/* 1: Use the `opa_scale` style property to set the opacity of an object and its children at once*/ /* 1: Use the `opa_scale` style property to set the opacity of an object and its children at once*/
#define LV_USE_OPA_SCALE 1 #define LV_USE_OPA_SCALE 1
/* 1: Use image zoom and rotation*/
#define LV_USE_IMG_TRANSFORM 1
/* 1: Enable object groups (for keyboard/encoder navigation) */ /* 1: Enable object groups (for keyboard/encoder navigation) */
#define LV_USE_GROUP 1 #define LV_USE_GROUP 1
#if LV_USE_GROUP #if LV_USE_GROUP
@ -192,6 +195,9 @@ typedef void * lv_fs_drv_user_data_t;
/*1: Show CPU usage and FPS count in the right bottom corner*/ /*1: Show CPU usage and FPS count in the right bottom corner*/
#define LV_USE_PERF_MONITOR 0 #define LV_USE_PERF_MONITOR 0
/*1: Use the functions and types from the older API if possible */
#define LV_USE_API_EXTENSION_V6 1
/*======================== /*========================
* Image decoder and cache * Image decoder and cache
*========================*/ *========================*/

View File

@ -30,6 +30,7 @@ extern "C" {
/*--------------------- /*---------------------
* V6.0 COMPATIBILITY * V6.0 COMPATIBILITY
*--------------------*/ *--------------------*/
#if LV_USE_API_EXTENSION_V6
static inline void lv_task_once(lv_task_t * task) static inline void lv_task_once(lv_task_t * task)
{ {
@ -147,6 +148,36 @@ static inline void lv_roller_set_fix_width(lv_obj_t * roller, lv_coord_t w)
#endif #endif
#if LV_USE_PAGE
#define lv_scrlbar_mode_t lv_scrollbar_mode_t
#define LV_SCRLBAR_MODE_OFF LV_SCROLLBAR_MODE_OFF
#define LV_SCRLBAR_MODE_ON LV_SCRILLBAR_MODE_ON
#define LV_SCRLBAR_MODE_DRAG LV_SCROLLBAR_MODE_DRAG
#define LV_SCRLBAR_MODE_AUTO LV_SCROLLBAR_MODE_AUTO
#define LV_SCRLBAR_MODE_HIDE LV_SCROLLBAR_MODE_HIDE
#define LV_SCRLBAR_MODE_UNHIDE LV_SCROLLBAR_MODE_UNHIDE
static inline void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode)
{
lv_page_set_scrollbar_mode(page, sb_mode);
}
static inline lv_scrollbar_mode_t lv_page_get_scrlbar_mode(lv_obj_t * page)
{
return lv_page_get_scrollbar_mode(page);
}
static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page)
{
return lv_page_get_scrllable(page);
}
#endif
#endif /*LV_USE_API_EXTENSION_V6*/
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/

View File

@ -252,6 +252,11 @@
#define LV_USE_OPA_SCALE 1 #define LV_USE_OPA_SCALE 1
#endif #endif
/* 1: Use image zoom and rotation*/
#ifndef LV_USE_IMG_TRANSFORM
#define LV_USE_IMG_TRANSFORM 1
#endif
/* 1: Enable object groups (for keyboard/encoder navigation) */ /* 1: Enable object groups (for keyboard/encoder navigation) */
#ifndef LV_USE_GROUP #ifndef LV_USE_GROUP
#define LV_USE_GROUP 1 #define LV_USE_GROUP 1
@ -285,6 +290,11 @@
#define LV_USE_PERF_MONITOR 0 #define LV_USE_PERF_MONITOR 0
#endif #endif
/*1: Use the functions and types from the older API if possible */
#ifndef LV_USE_API_EXTENSION_V6
#define LV_USE_API_EXTENSION_V6 1
#endif
/*======================== /*========================
* Image decoder and cache * Image decoder and cache
*========================*/ *========================*/

View File

@ -1324,7 +1324,7 @@ lv_res_t lv_obj_handle_get_type_signal(lv_obj_type_t * buf, const char * name);
/** /**
* Initialize a rectangle descriptor from an object's styles * Initialize a rectangle descriptor from an object's styles
* @param obj pointer to an object * @param obj pointer to an object
* @param type type of style. E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_STYLE_REL` or `LV_PAGE_STYLE_SCRL` * @param type type of style. E.g. `LV_OBJ_PART_MAIN`, `LV_BTN_SLIDER_KOB`
* @param draw_dsc the descriptor the initialize * @param draw_dsc the descriptor the initialize
* @note Only the relevant fields will be set. * @note Only the relevant fields will be set.
* E.g. if `border width == 0` the other border properties won't be evaluated. * E.g. if `border width == 0` the other border properties won't be evaluated.

View File

@ -377,7 +377,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
/*Go to the first displayed pixel of the map*/ /*Go to the first displayed pixel of the map*/
int32_t map_w = lv_area_get_width(map_area); int32_t map_w = lv_area_get_width(map_area);
int32_t map_h = lv_area_get_height(map_area);
const uint8_t * map_buf_tmp = map_p; const uint8_t * map_buf_tmp = map_p;
map_buf_tmp += map_w * (draw_area.y1 - (map_area->y1 - disp_area->y1)) * px_size_byte; map_buf_tmp += map_w * (draw_area.y1 - (map_area->y1 - disp_area->y1)) * px_size_byte;
map_buf_tmp += (draw_area.x1 - (map_area->x1 - disp_area->x1)) * px_size_byte; map_buf_tmp += (draw_area.x1 - (map_area->x1 - disp_area->x1)) * px_size_byte;
@ -397,8 +396,11 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
lv_coord_t draw_area_h = lv_area_get_height(&draw_area); lv_coord_t draw_area_h = lv_area_get_height(&draw_area);
lv_coord_t draw_area_w = lv_area_get_width(&draw_area); lv_coord_t draw_area_w = lv_area_get_width(&draw_area);
#if LV_USE_IMG_TRANSFORM
bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false; bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false;
#else
bool transform = false;
#endif
/*Simple ARGB image. Handle it as special case because it's very common*/ /*Simple ARGB image. Handle it as special case because it's very common*/
if(other_mask_cnt == 0 && !transform && !chroma_key && draw_dsc->recolor_opa == LV_OPA_TRANSP && alpha_byte) { if(other_mask_cnt == 0 && !transform && !chroma_key && draw_dsc->recolor_opa == LV_OPA_TRANSP && alpha_byte) {
#if LV_USE_GPU_STM32_DMA2D && LV_COLOR_DEPTH == 32 #if LV_USE_GPU_STM32_DMA2D && LV_COLOR_DEPTH == 32
@ -457,6 +459,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
} }
/*Most complicated case: transform or other mask or chroma keyed*/ /*Most complicated case: transform or other mask or chroma keyed*/
else { else {
#if LV_USE_IMG_TRANSFORM
lv_img_transform_dsc_t trans_dsc; lv_img_transform_dsc_t trans_dsc;
lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t)); lv_memset_00(&trans_dsc, sizeof(lv_img_transform_dsc_t));
if(transform) { if(transform) {
@ -468,7 +472,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
trans_dsc.cfg.zoom = draw_dsc->zoom; trans_dsc.cfg.zoom = draw_dsc->zoom;
trans_dsc.cfg.src = map_p; trans_dsc.cfg.src = map_p;
trans_dsc.cfg.src_w = map_w; trans_dsc.cfg.src_w = map_w;
trans_dsc.cfg.src_h = map_h; trans_dsc.cfg.src_h = lv_area_get_height(map_area);;
trans_dsc.cfg.cf = cf; trans_dsc.cfg.cf = cf;
trans_dsc.cfg.pivot_x = draw_dsc->pivot.x; trans_dsc.cfg.pivot_x = draw_dsc->pivot.x;
trans_dsc.cfg.pivot_y = draw_dsc->pivot.y; trans_dsc.cfg.pivot_y = draw_dsc->pivot.y;
@ -477,7 +481,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
lv_img_buf_transform_init(&trans_dsc); lv_img_buf_transform_init(&trans_dsc);
} }
#endif
uint16_t recolor_premult[3] = {0}; uint16_t recolor_premult[3] = {0};
lv_opa_t recolor_opa_inv = 255 - draw_dsc->recolor_opa; lv_opa_t recolor_opa_inv = 255 - draw_dsc->recolor_opa;
if(draw_dsc->recolor_opa != 0) { if(draw_dsc->recolor_opa != 0) {
@ -496,15 +500,38 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
int32_t x; int32_t x;
int32_t y; int32_t y;
#if LV_USE_IMG_TRANSFORM
int32_t rot_y = disp_area->y1 + draw_area.y1 - map_area->y1; int32_t rot_y = disp_area->y1 + draw_area.y1 - map_area->y1;
#endif
for(y = 0; y < draw_area_h; y++) { for(y = 0; y < draw_area_h; y++) {
map_px = map_buf_tmp; map_px = map_buf_tmp;
uint32_t px_i_start = px_i; uint32_t px_i_start = px_i;
#if LV_USE_IMG_TRANSFORM
int32_t rot_x = disp_area->x1 + draw_area.x1 - map_area->x1; int32_t rot_x = disp_area->x1 + draw_area.x1 - map_area->x1;
#endif
for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) { for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) {
if(transform == false) {
#if LV_USE_IMG_TRANSFORM
if(transform) {
/*Transform*/
bool ret;
ret = lv_img_buf_transform(&trans_dsc, rot_x + x, rot_y + y);
if(ret == false) {
mask_buf[px_i] = LV_OPA_TRANSP;
continue;
}
else {
mask_buf[px_i] = trans_dsc.res.opa;
c.full = trans_dsc.res.color.full;
}
}
/*No transform*/
else
#endif
{
if(alpha_byte) { if(alpha_byte) {
lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
mask_buf[px_i] = px_opa; mask_buf[px_i] = px_opa;
@ -531,19 +558,6 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
} }
} }
} }
else {
/*Transform*/
bool ret;
ret = lv_img_buf_transform(&trans_dsc, rot_x + x, rot_y + y);
if(ret == false) {
mask_buf[px_i] = LV_OPA_TRANSP;
continue;
}
else {
mask_buf[px_i] = trans_dsc.res.opa;
c.full = trans_dsc.res.color.full;
}
}
if(draw_dsc->recolor_opa != 0) { if(draw_dsc->recolor_opa != 0) {
c = lv_color_mix_premult(recolor_premult, c, recolor_opa_inv); c = lv_color_mix_premult(recolor_premult, c, recolor_opa_inv);

View File

@ -411,6 +411,8 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
} }
} }
#if LV_USE_IMG_TRANSFORM
/** /**
* Initialize a descriptor to tranform an image * Initialize a descriptor to tranform an image
* @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized * @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized
@ -454,7 +456,7 @@ void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
dsc->res.opa = LV_OPA_COVER; dsc->res.opa = LV_OPA_COVER;
dsc->res.color = dsc->cfg.color; dsc->res.color = dsc->cfg.color;
} }
#endif
/** /**
* Get the area of a rectangle if its rotated and scaled * Get the area of a rectangle if its rotated and scaled
@ -468,7 +470,7 @@ void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc)
void lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, void lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom,
lv_point_t * pivot) lv_point_t * pivot)
{ {
#if LV_USE_IMG_TRANSFORM
int32_t angle_low = angle / 10; int32_t angle_low = angle / 10;
int32_t angle_hight = angle_low + 1; int32_t angle_hight = angle_low + 1;
int32_t angle_rem = angle - (angle_low * 10); int32_t angle_rem = angle - (angle_low * 10);
@ -520,9 +522,15 @@ void lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h
res->x2 = LV_MATH_MAX4(lb.x, lt.x, rb.x, rt.x); res->x2 = LV_MATH_MAX4(lb.x, lt.x, rb.x, rt.x);
res->y1 = LV_MATH_MIN4(lb.y, lt.y, rb.y, rt.y); res->y1 = LV_MATH_MIN4(lb.y, lt.y, rb.y, rt.y);
res->y2 = LV_MATH_MAX4(lb.y, lt.y, rb.y, rt.y); res->y2 = LV_MATH_MAX4(lb.y, lt.y, rb.y, rt.y);
#else
res->x1 = 0;
res->y1 = 0;
res->x2 = w;
res->y2 = h;
#endif
} }
#if LV_USE_IMG_TRANSFORM
/** /**
* Continue transformation by taking the neighbors into account * Continue transformation by taking the neighbors into account
* @param dsc pointer to the transformation descriptor * @param dsc pointer to the transformation descriptor
@ -642,6 +650,7 @@ bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc)
return true; return true;
} }
#endif
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/

View File

@ -252,6 +252,7 @@ void lv_img_buf_free(lv_img_dsc_t * dsc);
uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf); uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
#if LV_USE_IMG_TRANSFORM
/** /**
* Initialize a descriptor to rotate an image * Initialize a descriptor to rotate an image
* @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized * @param dsc pointer to an `lv_img_transform_dsc_t` variable whose `cfg` field is initialized
@ -264,6 +265,7 @@ void lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc);
*/ */
bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc); bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t * dsc);
/** /**
* Get which color and opa would come to a pixel if it were rotated * Get which color and opa would come to a pixel if it were rotated
* @param dsc a descriptor initialized by `lv_img_buf_rotate_init` * @param dsc a descriptor initialized by `lv_img_buf_rotate_init`
@ -351,7 +353,7 @@ static inline bool lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t
return ret; return ret;
} }
#endif
/** /**
* Get the area of a rectangle if its rotated and scaled * Get the area of a rectangle if its rotated and scaled
* @param res store the coordinates here * @param res store the coordinates here

View File

@ -1129,7 +1129,7 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG);
lv_style_list_add_style(list, &scr); lv_style_list_add_style(list, &scr);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRL); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG);
@ -1160,8 +1160,8 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG);
lv_style_list_add_style(list, &scr); lv_style_list_add_style(list, &scr);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCRLBAR); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCRLBAR); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
lv_style_list_add_style(list, &sb); lv_style_list_add_style(list, &sb);
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
@ -1321,8 +1321,8 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR);
lv_style_list_add_style(list, &ta_cursor); lv_style_list_add_style(list, &ta_cursor);
lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCRLBAR); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR);
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCRLBAR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR);
lv_style_list_add_style(list, &sb); lv_style_list_add_style(list, &sb);
break; break;

View File

@ -779,7 +779,7 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG);
lv_style_list_add_style(list, &style_scr); lv_style_list_add_style(list, &style_scr);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRL); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG);
@ -811,8 +811,8 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG);
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCRLBAR); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCRLBAR); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
lv_style_list_add_style(list, &style_sb); lv_style_list_add_style(list, &style_sb);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH);
@ -977,8 +977,8 @@ static void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_CURSOR);
lv_style_list_add_style(list, &style_ta_cursor); lv_style_list_add_style(list, &style_ta_cursor);
lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCRLBAR); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR);
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCRLBAR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR);
lv_style_list_add_style(list, &style_sb); lv_style_list_add_style(list, &style_sb);
break; break;
#endif #endif

View File

@ -623,8 +623,8 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG);
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRL); lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCRL); list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCRLLABLE);
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
lv_style_list_add_style(list, &style_color); lv_style_list_add_style(list, &style_color);
@ -662,8 +662,8 @@ void theme_apply(lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_BG);
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCRLBAR); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCRLBAR); list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH); lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH);
@ -820,8 +820,8 @@ void theme_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_bg);
lv_style_list_add_style(list, &style_tight); lv_style_list_add_style(list, &style_tight);
lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCRLBAR); lv_obj_clean_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR);
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCRLBAR); list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_SCROLLBAR);
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
break; break;
#endif #endif

View File

@ -278,6 +278,7 @@ void lv_canvas_transform(lv_obj_t * canvas, lv_img_dsc_t * img, int16_t angle, u
lv_coord_t offset_y, lv_coord_t offset_y,
int32_t pivot_x, int32_t pivot_y, bool antialias) int32_t pivot_x, int32_t pivot_y, bool antialias)
{ {
#if LV_USE_IMG_TRANSFORM
LV_ASSERT_OBJ(canvas, LV_OBJX_NAME); LV_ASSERT_OBJ(canvas, LV_OBJX_NAME);
LV_ASSERT_NULL(img); LV_ASSERT_NULL(img);
@ -362,6 +363,9 @@ void lv_canvas_transform(lv_obj_t * canvas, lv_img_dsc_t * img, int16_t angle, u
} }
lv_obj_invalidate(canvas); lv_obj_invalidate(canvas);
#else
LV_LOG_WARN("LV_USE_IMG_TRANSFORM is disabled in lv_conf.h");
#endif
} }

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_scrl(ext->page), LV_PROTECT_CLICK_FOCUS); lv_obj_add_protect(lv_page_get_scrllable(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_scrl(ext->page)); if(ancestor_page_scrl_signal == NULL) ancestor_page_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(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);
lv_dropdown_page_ext_t * page_ext = lv_obj_allocate_ext_attr(ext->page, sizeof(lv_dropdown_page_ext_t)); lv_dropdown_page_ext_t * page_ext = lv_obj_allocate_ext_attr(ext->page, sizeof(lv_dropdown_page_ext_t));
@ -603,7 +603,8 @@ 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_scrl(ext->page), lv_dropdown_page_scrl_signal); lv_obj_set_signal_cb(lv_page_get_scrllable(ext->page), lv_dropdown_page_scrl_signal);
lv_page_set_scrollbar_mode(ext->page, LV_SCRILLBAR_MODE_ON);
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);
@ -849,11 +850,11 @@ static lv_design_res_t lv_dropdown_page_design(lv_obj_t * page, const lv_area_t
has_common = lv_area_intersect(&clip_area_core, clip_area, &ext->page->coords); has_common = lv_area_intersect(&clip_area_core, clip_area, &ext->page->coords);
if(has_common) { if(has_common) {
if(ext->pr_opt_id != LV_DROPDOWN_PR_NONE) { if(ext->pr_opt_id != LV_DROPDOWN_PR_NONE) {
draw_box_label(ddlist, clip_area, ext->pr_opt_id, LV_STATE_PRESSED); draw_box_label(ddlist, &clip_area_core, ext->pr_opt_id, LV_STATE_PRESSED);
} }
if(ext->show_selected) { if(ext->show_selected) {
draw_box_label(ddlist, clip_area, ext->sel_opt_id, LV_STATE_DEFAULT); draw_box_label(ddlist, &clip_area_core, ext->sel_opt_id, LV_STATE_DEFAULT);
} }
} }
} }
@ -1022,7 +1023,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_scrl(page); lv_obj_t * scrl = lv_page_get_scrllable(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) {
@ -1296,7 +1297,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_scrl(ext->page); lv_obj_t * scrl = lv_page_get_scrllable(ext->page);
lv_obj_t * label = get_label(ddlist); lv_obj_t * label = get_label(ddlist);
if(label == NULL) return; if(label == NULL) return;
@ -1316,7 +1317,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_scrl(ext->page), NULL); return lv_obj_get_child(lv_page_get_scrllable(ext->page), NULL);
} }
#endif #endif

View File

@ -94,10 +94,10 @@ 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_scrl_fit2(list, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrllable_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_sb_mode(list, LV_SCRLBAR_MODE_DRAG); lv_list_set_scrollbar_mode(list, LV_SCROLLBAR_MODE_DRAG);
lv_theme_apply(list, LV_THEME_LIST); lv_theme_apply(list, LV_THEME_LIST);
@ -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_scrl(list); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(list); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl_fit2(list, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrllable_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_scrl_fit2(list, LV_FIT_TIGHT, LV_FIT_TIGHT); lv_page_set_scrllable_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_scrl(list); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(list); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(list); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(list); lv_obj_t * scrl = lv_page_get_scrllable(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

@ -122,9 +122,9 @@ void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn);
* @param list pointer to a list object * @param list pointer to a list object
* @param sb_mode the new mode from 'lv_page_sb_mode_t' enum * @param sb_mode the new mode from 'lv_page_sb_mode_t' enum
*/ */
static inline void lv_list_set_sb_mode(lv_obj_t * list, lv_scrlbar_mode_t mode) static inline void lv_list_set_scrollbar_mode(lv_obj_t * list, lv_scrollbar_mode_t mode)
{ {
lv_page_set_scrlbar_mode(list, mode); lv_page_set_scrollbar_mode(list, mode);
} }
/** /**
@ -239,11 +239,11 @@ lv_layout_t lv_list_get_layout(lv_obj_t * list);
/** /**
* Get the scroll bar mode of a list * Get the scroll bar mode of a list
* @param list pointer to a list object * @param list pointer to a list object
* @return scrollbar mode from 'lv_page_sb_mode_t' enum * @return scrollbar mode from 'lv_scrollbar_mode_t' enum
*/ */
static inline lv_scrlbar_mode_t lv_list_get_sb_mode(const lv_obj_t * list) static inline lv_scrollbar_mode_t lv_list_get_scrollbar_mode(const lv_obj_t * list)
{ {
return lv_page_get_sb_mode(list); return lv_page_get_scrollbar_mode(list);
} }
/** /**

View File

@ -101,7 +101,7 @@ lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy)
lv_style_list_init(&ext->scrlbar.style); lv_style_list_init(&ext->scrlbar.style);
ext->scrlbar.hor_draw = 0; ext->scrlbar.hor_draw = 0;
ext->scrlbar.ver_draw = 0; ext->scrlbar.ver_draw = 0;
ext->scrlbar.mode = LV_SCRLBAR_MODE_AUTO; ext->scrlbar.mode = LV_SCROLLBAR_MODE_AUTO;
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_style_list_init(&ext->edge_flash.style); lv_style_list_init(&ext->edge_flash.style);
ext->edge_flash.enabled = 0; ext->edge_flash.enabled = 0;
@ -131,7 +131,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_signal_cb(page, lv_page_signal);
lv_obj_set_design_cb(page, lv_page_design); lv_obj_set_design_cb(page, lv_page_design);
lv_page_set_scrlbar_mode(page, ext->scrlbar.mode); lv_page_set_scrollbar_mode(page, ext->scrlbar.mode);
lv_theme_apply(page, LV_THEME_PAGE); lv_theme_apply(page, LV_THEME_PAGE);
@ -151,7 +151,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_signal_cb(page, lv_page_signal);
lv_obj_set_design_cb(page, lv_page_design); lv_obj_set_design_cb(page, lv_page_design);
lv_page_set_scrlbar_mode(page, copy_ext->scrlbar.mode); lv_page_set_scrollbar_mode(page, copy_ext->scrlbar.mode);
} }
@ -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_scrl(page); lv_obj_t * scrl = lv_page_get_scrllable(page);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@ -183,19 +183,19 @@ void lv_page_clean(lv_obj_t * page)
* @param page pointer to a page object * @param page pointer to a page object
* @param sb_mode the new mode from 'lv_page_sb.mode_t' enum * @param sb_mode the new mode from 'lv_page_sb.mode_t' enum
*/ */
void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode) void lv_page_set_scrollbar_mode(lv_obj_t * page, lv_scrollbar_mode_t sb_mode)
{ {
LV_ASSERT_OBJ(page, LV_OBJX_NAME); LV_ASSERT_OBJ(page, LV_OBJX_NAME);
lv_page_ext_t * ext = lv_obj_get_ext_attr(page); lv_page_ext_t * ext = lv_obj_get_ext_attr(page);
if(ext->scrlbar.mode == sb_mode) return; if(ext->scrlbar.mode == sb_mode) return;
if(sb_mode == LV_SCRLBAR_MODE_HIDE) if(sb_mode == LV_SCROLLBAR_MODE_HIDE)
ext->scrlbar.mode |= LV_SCRLBAR_MODE_HIDE; /*Set the hidden flag*/ ext->scrlbar.mode |= LV_SCROLLBAR_MODE_HIDE; /*Set the hidden flag*/
else if(sb_mode == LV_SCRLBAR_MODE_UNHIDE) else if(sb_mode == LV_SCROLLBAR_MODE_UNHIDE)
ext->scrlbar.mode &= (~LV_SCRLBAR_MODE_HIDE); /*Clear the hidden flag*/ ext->scrlbar.mode &= (~LV_SCROLLBAR_MODE_HIDE); /*Clear the hidden flag*/
else { else {
if(ext->scrlbar.mode & LV_SCRLBAR_MODE_HIDE) sb_mode |= LV_SCRLBAR_MODE_HIDE; if(ext->scrlbar.mode & LV_SCROLLBAR_MODE_HIDE) sb_mode |= LV_SCROLLBAR_MODE_HIDE;
ext->scrlbar.mode = sb_mode; ext->scrlbar.mode = sb_mode;
} }
@ -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_scrl(const lv_obj_t * page) lv_obj_t * lv_page_get_scrllable(const lv_obj_t * page)
{ {
LV_ASSERT_OBJ(page, LV_OBJX_NAME); LV_ASSERT_OBJ(page, LV_OBJX_NAME);
@ -302,7 +302,7 @@ uint16_t lv_page_get_anim_time(const lv_obj_t * page)
* @param page pointer to a page object * @param page pointer to a page object
* @return the mode from 'lv_page_sb.mode_t' enum * @return the mode from 'lv_page_sb.mode_t' enum
*/ */
lv_scrlbar_mode_t lv_page_get_sb_mode(const lv_obj_t * page) lv_scrollbar_mode_t lv_page_get_scrollbar_mode(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_scrl(page); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(page); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(page); lv_obj_t * scrl = lv_page_get_scrllable(page);
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
lv_anim_t a; lv_anim_t a;
@ -707,11 +707,11 @@ static lv_design_res_t lv_page_design(lv_obj_t * page, const lv_area_t * clip_ar
lv_draw_rect_dsc_t rect_dsc; lv_draw_rect_dsc_t rect_dsc;
lv_draw_rect_dsc_init(&rect_dsc); lv_draw_rect_dsc_init(&rect_dsc);
lv_obj_init_draw_rect_dsc(page, LV_PAGE_PART_SCROLLBAR, &rect_dsc); lv_obj_init_draw_rect_dsc(page, LV_PAGE_PART_SCROLLBAR, &rect_dsc);
if(ext->scrlbar.hor_draw && (ext->scrlbar.mode & LV_SCRLBAR_MODE_HIDE) == 0) { if(ext->scrlbar.hor_draw && (ext->scrlbar.mode & LV_SCROLLBAR_MODE_HIDE) == 0) {
lv_draw_rect(&sb_hor_area, clip_area, &rect_dsc); lv_draw_rect(&sb_hor_area, clip_area, &rect_dsc);
} }
if(ext->scrlbar.ver_draw && (ext->scrlbar.mode & LV_SCRLBAR_MODE_HIDE) == 0) { if(ext->scrlbar.ver_draw && (ext->scrlbar.mode & LV_SCROLLBAR_MODE_HIDE) == 0) {
lv_draw_rect(&sb_ver_area, clip_area, &rect_dsc); lv_draw_rect(&sb_ver_area, clip_area, &rect_dsc);
} }
} }
@ -758,7 +758,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_scrl(page), LV_CONT_PART_MAIN); if(info->part == LV_PAGE_PART_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(page), 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;
} }
@ -948,7 +948,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
scrl_reposition(page); scrl_reposition(page);
} }
else if(sign == LV_SIGNAL_DRAG_BEGIN) { else if(sign == LV_SIGNAL_DRAG_BEGIN) {
if(page_ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) { if(page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
scrlbar_refresh(page); scrlbar_refresh(page);
} }
} }
@ -959,10 +959,10 @@ 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_scrl(scroller_page), false); lv_obj_set_drag_parent(lv_page_get_scrllable(scroller_page), false);
/*Hide scrollbars if required*/ /*Hide scrollbars if required*/
if(scroller_page_ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) { if(scroller_page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
lv_area_t sb_area_tmp; lv_area_t sb_area_tmp;
if(scroller_page_ext->scrlbar.hor_draw) { if(scroller_page_ext->scrlbar.hor_draw) {
lv_area_copy(&sb_area_tmp, &scroller_page_ext->scrlbar.hor_area); lv_area_copy(&sb_area_tmp, &scroller_page_ext->scrlbar.hor_area);
@ -990,10 +990,10 @@ 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_scrl(scroller_page), false); lv_obj_set_drag_parent(lv_page_get_scrllable(scroller_page), false);
/*Hide scrollbars if required*/ /*Hide scrollbars if required*/
if(scroller_page_ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) { if(scroller_page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
scroller_page_ext->scrlbar.hor_draw = 0; scroller_page_ext->scrlbar.hor_draw = 0;
scroller_page_ext->scrlbar.ver_draw = 0; scroller_page_ext->scrlbar.ver_draw = 0;
lv_obj_invalidate(scroller_page); lv_obj_invalidate(scroller_page);
@ -1003,7 +1003,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
} }
/*Hide scrollbars if required*/ /*Hide scrollbars if required*/
if(page_ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) { if(page_ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) {
lv_area_t sb_area_tmp; lv_area_t sb_area_tmp;
if(page_ext->scrlbar.hor_draw) { if(page_ext->scrlbar.hor_draw) {
lv_area_copy(&sb_area_tmp, &page_ext->scrlbar.hor_area); lv_area_copy(&sb_area_tmp, &page_ext->scrlbar.hor_area);
@ -1112,7 +1112,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_scrl(page); lv_obj_t * scrl = lv_page_get_scrllable(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;
@ -1209,9 +1209,9 @@ static void scrlbar_refresh(lv_obj_t * page)
lv_coord_t sb_hor_pad = LV_MATH_MAX(sb_width, sb_right); lv_coord_t sb_hor_pad = LV_MATH_MAX(sb_width, sb_right);
lv_coord_t sb_ver_pad = LV_MATH_MAX(sb_width, sb_bottom); lv_coord_t sb_ver_pad = LV_MATH_MAX(sb_width, sb_bottom);
if(ext->scrlbar.mode == LV_SCRLBAR_MODE_OFF) return; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_OFF) return;
if(ext->scrlbar.mode == LV_SCRLBAR_MODE_ON) { if(ext->scrlbar.mode == LV_SCRILLBAR_MODE_ON) {
ext->scrlbar.hor_draw = 1; ext->scrlbar.hor_draw = 1;
ext->scrlbar.ver_draw = 1; ext->scrlbar.ver_draw = 1;
} }
@ -1240,7 +1240,7 @@ static void scrlbar_refresh(lv_obj_t * page)
lv_area_set_width(&ext->scrlbar.hor_area, obj_w - 2 * sb_hor_pad); lv_area_set_width(&ext->scrlbar.hor_area, obj_w - 2 * sb_hor_pad);
lv_area_set_pos(&ext->scrlbar.hor_area, sb_hor_pad, lv_area_set_pos(&ext->scrlbar.hor_area, sb_hor_pad,
obj_h - sb_width - sb_bottom); obj_h - sb_width - sb_bottom);
if(ext->scrlbar.mode == LV_SCRLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 0;
} }
/*Smaller horizontal scrollbar*/ /*Smaller horizontal scrollbar*/
else { else {
@ -1255,7 +1255,7 @@ static void scrlbar_refresh(lv_obj_t * page)
(scrl_w + bg_left + bg_right - obj_w), (scrl_w + bg_left + bg_right - obj_w),
obj_h - sb_width - sb_bottom); obj_h - sb_width - sb_bottom);
if(ext->scrlbar.mode == LV_SCRLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.hor_draw = 1;
} }
/*Full sized vertical scroll bar*/ /*Full sized vertical scroll bar*/
@ -1263,7 +1263,7 @@ static void scrlbar_refresh(lv_obj_t * page)
lv_area_set_height(&ext->scrlbar.ver_area, obj_h - 2 * sb_ver_pad); lv_area_set_height(&ext->scrlbar.ver_area, obj_h - 2 * sb_ver_pad);
lv_area_set_pos(&ext->scrlbar.ver_area, lv_area_set_pos(&ext->scrlbar.ver_area,
obj_w - sb_width - sb_right, sb_ver_pad); obj_w - sb_width - sb_right, sb_ver_pad);
if(ext->scrlbar.mode == LV_SCRLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 0;
} }
/*Smaller vertical scroll bar*/ /*Smaller vertical scroll bar*/
else { else {
@ -1278,7 +1278,7 @@ static void scrlbar_refresh(lv_obj_t * page)
(obj_h - size_tmp - 2 * sb_ver_pad)) / (obj_h - size_tmp - 2 * sb_ver_pad)) /
(scrl_h + bg_top + bg_bottom - obj_h)); (scrl_h + bg_top + bg_bottom - obj_h));
if(ext->scrlbar.mode == LV_SCRLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCRLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1; if(ext->scrlbar.mode == LV_SCROLLBAR_MODE_AUTO || ext->scrlbar.mode == LV_SCROLLBAR_MODE_DRAG) ext->scrlbar.ver_draw = 1;
} }
/*Invalidate the new scrollbar areas*/ /*Invalidate the new scrollbar areas*/

View File

@ -36,14 +36,14 @@ extern "C" {
/** Scrollbar modes: shows when should the scrollbars be visible*/ /** Scrollbar modes: shows when should the scrollbars be visible*/
enum { enum {
LV_SCRLBAR_MODE_OFF = 0x0, /**< Never show scroll bars*/ LV_SCROLLBAR_MODE_OFF = 0x0, /**< Never show scroll bars*/
LV_SCRLBAR_MODE_ON = 0x1, /**< Always show scroll bars*/ LV_SCRILLBAR_MODE_ON = 0x1, /**< Always show scroll bars*/
LV_SCRLBAR_MODE_DRAG = 0x2, /**< Show scroll bars when page is being dragged*/ LV_SCROLLBAR_MODE_DRAG = 0x2, /**< Show scroll bars when page is being dragged*/
LV_SCRLBAR_MODE_AUTO = 0x3, /**< Show scroll bars when the scrollable container is large enough to be scrolled*/ LV_SCROLLBAR_MODE_AUTO = 0x3, /**< Show scroll bars when the scrollable container is large enough to be scrolled*/
LV_SCRLBAR_MODE_HIDE = 0x4, /**< Hide the scroll bar temporally*/ LV_SCROLLBAR_MODE_HIDE = 0x4, /**< Hide the scroll bar temporally*/
LV_SCRLBAR_MODE_UNHIDE = 0x5, /**< Unhide the previously hidden scroll bar. Recover original mode too*/ LV_SCROLLBAR_MODE_UNHIDE = 0x5, /**< Unhide the previously hidden scroll bar. Recover original mode too*/
}; };
typedef uint8_t lv_scrlbar_mode_t; typedef uint8_t lv_scrollbar_mode_t;
/** Edges: describes the four edges of the page*/ /** Edges: describes the four edges of the page*/
enum { LV_PAGE_EDGE_LEFT = 0x1, LV_PAGE_EDGE_TOP = 0x2, LV_PAGE_EDGE_RIGHT = 0x4, LV_PAGE_EDGE_BOTTOM = 0x8 }; enum { LV_PAGE_EDGE_LEFT = 0x1, LV_PAGE_EDGE_TOP = 0x2, LV_PAGE_EDGE_RIGHT = 0x4, LV_PAGE_EDGE_BOTTOM = 0x8 };
@ -60,7 +60,7 @@ typedef struct {
lv_area_t ver_area; /*Vertical scrollbar area relative to the page (Handled by the library)*/ lv_area_t ver_area; /*Vertical scrollbar area relative to the page (Handled by the library)*/
uint8_t hor_draw : 1; /*1: horizontal scrollbar is visible now (Handled by the library)*/ uint8_t hor_draw : 1; /*1: horizontal scrollbar is visible now (Handled by the library)*/
uint8_t ver_draw : 1; /*1: vertical scrollbar is visible now (Handled by the library)*/ uint8_t ver_draw : 1; /*1: vertical scrollbar is visible now (Handled by the library)*/
lv_scrlbar_mode_t mode : 3; /*Scrollbar visibility from 'lv_page_sb_mode_t'*/ lv_scrollbar_mode_t mode : 3; /*Scrollbar visibility from 'lv_scrollbar_mode_t'*/
} scrlbar; } scrlbar;
#if LV_USE_ANIMATION #if LV_USE_ANIMATION
struct { struct {
@ -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_scrl(const lv_obj_t * page); lv_obj_t * lv_page_get_scrllable(const lv_obj_t * page);
/** /**
* Get the animation time * Get the animation time
@ -135,7 +135,7 @@ uint16_t lv_page_get_anim_time(const lv_obj_t * page);
* @param page pointer to a page object * @param page pointer to a page object
* @param sb_mode the new mode from 'lv_page_sb.mode_t' enum * @param sb_mode the new mode from 'lv_page_sb.mode_t' enum
*/ */
void lv_page_set_scrlbar_mode(lv_obj_t * page, lv_scrlbar_mode_t sb_mode); void lv_page_set_scrollbar_mode(lv_obj_t * page, lv_scrollbar_mode_t sb_mode);
/** /**
* Set the animation time for the page * Set the animation time for the page
@ -170,9 +170,9 @@ 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_scrl_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top, lv_fit_t bottom) static inline void lv_page_set_scrllable_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_t right, lv_fit_t top, lv_fit_t bottom)
{ {
lv_cont_set_fit4(lv_page_get_scrl(page), left, right, top, bottom); lv_cont_set_fit4(lv_page_get_scrllable(page), left, right, top, bottom);
} }
/** /**
@ -182,9 +182,9 @@ static inline void lv_page_set_scrl_fit4(lv_obj_t * page, lv_fit_t left, lv_fit_
* @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_scrl_fit2(lv_obj_t * page, lv_fit_t hor, lv_fit_t ver) static inline void lv_page_set_scrllable_fit2(lv_obj_t * page, lv_fit_t hor, lv_fit_t ver)
{ {
lv_cont_set_fit2(lv_page_get_scrl(page), hor, ver); lv_cont_set_fit2(lv_page_get_scrllable(page), hor, ver);
} }
/** /**
@ -193,9 +193,9 @@ static inline void lv_page_set_scrl_fit2(lv_obj_t * page, lv_fit_t hor, lv_fit_t
* @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_scrl_fit(lv_obj_t * page, lv_fit_t fit) static inline void lv_page_set_scrllable_fit(lv_obj_t * page, lv_fit_t fit)
{ {
lv_cont_set_fit(lv_page_get_scrl(page), fit); lv_cont_set_fit(lv_page_get_scrllable(page), fit);
} }
/** /**
@ -205,7 +205,7 @@ static inline void lv_page_set_scrl_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_scrl(page), w); lv_obj_set_width(lv_page_get_scrllable(page), w);
} }
/** /**
@ -215,7 +215,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_scrl(page), h); lv_obj_set_height(lv_page_get_scrllable(page), h);
} }
/** /**
@ -225,7 +225,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_scrl(page), layout); lv_cont_set_layout(lv_page_get_scrllable(page), layout);
} }
/*===================== /*=====================
@ -237,7 +237,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 page pointer to a page object
* @return the mode from 'lv_page_sb.mode_t' enum * @return the mode from 'lv_page_sb.mode_t' enum
*/ */
lv_scrlbar_mode_t lv_page_get_sb_mode(const lv_obj_t * page); lv_scrollbar_mode_t lv_page_get_scrollbar_mode(const lv_obj_t * page);
/** /**
* Get the scroll propagation property * Get the scroll propagation property
@ -300,7 +300,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_scrl(page)); return lv_obj_get_width(lv_page_get_scrllable(page));
} }
/** /**
@ -310,7 +310,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_scrl(page)); return lv_obj_get_height(lv_page_get_scrllable(page));
} }
/** /**
@ -320,7 +320,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_scrl(page)); return lv_cont_get_layout(lv_page_get_scrllable(page));
} }
/** /**
@ -330,7 +330,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_scrl(page)); return lv_cont_get_fit_left(lv_page_get_scrllable(page));
} }
/** /**
@ -340,7 +340,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_scrl(page)); return lv_cont_get_fit_right(lv_page_get_scrllable(page));
} }
/** /**
@ -350,7 +350,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_scrl(page)); return lv_cont_get_fit_top(lv_page_get_scrllable(page));
} }
/** /**
@ -360,7 +360,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_scrl(page)); return lv_cont_get_fit_bottom(lv_page_get_scrllable(page));
} }
/*===================== /*=====================

View File

@ -75,7 +75,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_scrl(roller)); if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(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*/
@ -103,9 +103,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_scrl(roller); lv_obj_t * scrl = lv_page_get_scrllable(roller);
lv_obj_set_drag(scrl, true); lv_obj_set_drag(scrl, true);
lv_page_set_scrl_fit2(roller, LV_FIT_PARENT, LV_FIT_NONE); /*Height is specified directly*/ lv_page_set_scrllable_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);
@ -122,7 +122,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_scrl(roller); lv_obj_t * scrl = lv_page_get_scrllable(roller);
lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal); lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);
} }
@ -498,7 +498,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_scrl(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); lv_anim_del(lv_page_get_scrllable(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);
@ -648,7 +648,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_scrl(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); lv_anim_del(lv_page_get_scrllable(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);
@ -729,7 +729,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_scrl(roller); lv_obj_t * roller_scrl = lv_page_get_scrllable(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);
@ -869,10 +869,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_scrl(roller), lv_obj_get_height(label) + lv_obj_get_height(roller)); lv_obj_set_height(lv_page_get_scrllable(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_scrl(roller), (lv_anim_exec_xcb_t)lv_obj_set_y); lv_anim_del(lv_page_get_scrllable(roller), (lv_anim_exec_xcb_t)lv_obj_set_y);
#endif #endif
refr_position(roller, LV_ANIM_OFF); refr_position(roller, LV_ANIM_OFF);
} }
@ -910,7 +910,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_scrl(roller); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(spinbox), false); lv_obj_set_click(lv_page_get_scrllable(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,18 +129,18 @@ 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_scrl(ext->content)); if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(ext->content));
lv_obj_set_signal_cb(lv_page_get_scrl(ext->content), tabview_scrl_signal); lv_obj_set_signal_cb(lv_page_get_scrllable(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_scrl(ext->content), LV_DRAG_DIR_ONE); lv_obj_set_drag_dir(lv_page_get_scrllable(ext->content), LV_DRAG_DIR_ONE);
lv_page_set_scrl_fit2(ext->content, LV_FIT_TIGHT, LV_FIT_PARENT); lv_page_set_scrllable_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_scrlbar_mode(ext->content, LV_SCRLBAR_MODE_OFF); lv_page_set_scrollbar_mode(ext->content, LV_SCROLLBAR_MODE_OFF);
lv_obj_clean_style_list(ext->content, LV_PAGE_PART_BG); lv_obj_clean_style_list(ext->content, LV_PAGE_PART_BG);
@ -165,8 +165,8 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
ext->tab_name_ptr[0] = ""; ext->tab_name_ptr[0] = "";
lv_btnmatrix_set_map(ext->btns, ext->tab_name_ptr); lv_btnmatrix_set_map(ext->btns, ext->tab_name_ptr);
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_BG_SCRL), lv_obj_get_style_list(copy, lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_BG_SCRLLABLE), lv_obj_get_style_list(copy,
LV_TABVIEW_PART_BG_SCRL)); LV_TABVIEW_PART_BG_SCRLLABLE));
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BG), lv_obj_get_style_list(copy, lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BG), lv_obj_get_style_list(copy,
LV_TABVIEW_PART_TAB_BG)); LV_TABVIEW_PART_TAB_BG));
lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BTN), lv_obj_get_style_list(copy, lv_style_list_copy(lv_obj_get_style_list(tabview, LV_TABVIEW_PART_TAB_BTN), lv_obj_get_style_list(copy,
@ -214,7 +214,7 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * tabview, const char * name)
/*Create the container page*/ /*Create the container page*/
lv_obj_t * h = lv_page_create(ext->content, NULL); 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_obj_set_size(h, lv_obj_get_width(tabview), lv_obj_get_height(ext->content));
lv_page_set_scrlbar_mode(h, LV_SCRLBAR_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_theme_apply(h, LV_THEME_TABVIEW_PAGE); lv_theme_apply(h, LV_THEME_TABVIEW_PAGE);
@ -306,7 +306,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_scrl(tab); lv_obj_t * scrl = lv_page_get_scrllable(tab);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@ -357,15 +357,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_scrl(ext->content), cont_x); lv_obj_set_x(lv_page_get_scrllable(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_scrl(ext->content)); lv_anim_set_var(&a, lv_page_get_scrllable(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_scrl(ext->content)), cont_x); lv_anim_set_values(&a, lv_obj_get_x(lv_page_get_scrllable(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 +529,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_scrl(ext->content); lv_obj_t * content_scrl = lv_page_get_scrllable(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);
@ -599,7 +599,7 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p
if(info->part == LV_TABVIEW_PART_TAB_BG) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BG); if(info->part == LV_TABVIEW_PART_TAB_BG) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BG);
else if(info->part == LV_TABVIEW_PART_TAB_BTN) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BTN); else if(info->part == LV_TABVIEW_PART_TAB_BTN) info->result = lv_obj_get_state(ext->btns, LV_BTNMATRIX_PART_BTN);
else if(info->part == LV_TABVIEW_PART_INDIC) info->result = lv_obj_get_state(ext->indic, LV_OBJ_PART_MAIN); else if(info->part == LV_TABVIEW_PART_INDIC) info->result = lv_obj_get_state(ext->indic, LV_OBJ_PART_MAIN);
else if(info->part == LV_TABVIEW_PART_BG_SCRL) info->result = lv_obj_get_state(ext->content, LV_PAGE_PART_SCROLLABLE); else if(info->part == LV_TABVIEW_PART_BG_SCRLLABLE) info->result = lv_obj_get_state(ext->content, LV_PAGE_PART_SCROLLABLE);
return LV_RES_OK; return LV_RES_OK;
} }
@ -769,7 +769,7 @@ static lv_style_list_t * lv_tabview_get_style(lv_obj_t * tabview, uint8_t part)
case LV_TABVIEW_PART_BG: case LV_TABVIEW_PART_BG:
style_dsc_p = &tabview->style_list; style_dsc_p = &tabview->style_list;
break; break;
case LV_TABVIEW_PART_BG_SCRL: case LV_TABVIEW_PART_BG_SCRLLABLE:
style_dsc_p = lv_obj_get_style_list(ext->content, LV_PAGE_PART_SCROLLABLE); style_dsc_p = lv_obj_get_style_list(ext->content, LV_PAGE_PART_SCROLLABLE);
break; break;
case LV_TABVIEW_PART_TAB_BG: case LV_TABVIEW_PART_TAB_BG:
@ -963,10 +963,10 @@ static void refr_content_size(lv_obj_t * tabview)
lv_obj_set_size(ext->content, cont_w, cont_h); lv_obj_set_size(ext->content, cont_w, cont_h);
/*Refresh the size of the tab pages too. `ext->content` has a layout to align the pages*/ /*Refresh the size of the tab pages too. `ext->content` has a layout to align the pages*/
lv_style_int_t bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_BG_SCRL); 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_SCRL); 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_scrl(ext->content); lv_obj_t * content_scrl = lv_page_get_scrllable(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

@ -69,7 +69,7 @@ enum {
LV_TABVIEW_PART_BG = LV_OBJ_PART_MAIN, LV_TABVIEW_PART_BG = LV_OBJ_PART_MAIN,
_LV_TABVIEW_PART_VIRTUAL_LAST = _LV_OBJ_PART_VIRTUAL_LAST, _LV_TABVIEW_PART_VIRTUAL_LAST = _LV_OBJ_PART_VIRTUAL_LAST,
LV_TABVIEW_PART_BG_SCRL = _LV_OBJ_PART_REAL_LAST, LV_TABVIEW_PART_BG_SCRLLABLE = _LV_OBJ_PART_REAL_LAST,
LV_TABVIEW_PART_TAB_BG, LV_TABVIEW_PART_TAB_BG,
LV_TABVIEW_PART_TAB_BTN, LV_TABVIEW_PART_TAB_BTN,
LV_TABVIEW_PART_INDIC, LV_TABVIEW_PART_INDIC,

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_scrl(ta)); if(scrl_signal == NULL) scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(ta));
if(scrl_design == NULL) scrl_design = lv_obj_get_design_cb(lv_page_get_scrl(ta)); if(scrl_design == NULL) scrl_design = lv_obj_get_design_cb(lv_page_get_scrllable(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_scrl(ta), lv_textarea_scrollable_signal); lv_obj_set_signal_cb(lv_page_get_scrllable(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_scrl_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrllable_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT);
ext->label = lv_label_create(ta, NULL); ext->label = lv_label_create(ta, NULL);
@ -148,7 +148,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
lv_label_set_text(ext->label, "Text area"); lv_label_set_text(ext->label, "Text area");
lv_obj_set_click(ext->label, false); lv_obj_set_click(ext->label, false);
lv_obj_set_size(ta, LV_TEXTAREA_DEF_WIDTH, LV_TEXTAREA_DEF_HEIGHT); lv_obj_set_size(ta, LV_TEXTAREA_DEF_WIDTH, LV_TEXTAREA_DEF_HEIGHT);
lv_textarea_set_sb_mode(ta, LV_SCRLBAR_MODE_DRAG); lv_textarea_set_sscrollbar_mode(ta, LV_SCROLLBAR_MODE_DRAG);
lv_obj_reset_style_list(ta, LV_PAGE_PART_SCROLLABLE); lv_obj_reset_style_list(ta, LV_PAGE_PART_SCROLLABLE);
lv_theme_apply(ta, LV_THEME_TEXTAREA); lv_theme_apply(ta, LV_THEME_TEXTAREA);
@ -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_scrl_fit2(ta, LV_FIT_MAX, LV_FIT_PARENT); lv_page_set_scrllable_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_scrl(ta), left, top); lv_obj_set_pos(lv_page_get_scrllable(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_scrl_fit2(ta, LV_FIT_PARENT, LV_FIT_TIGHT); lv_page_set_scrllable_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_scrl(ta), left, top); lv_obj_set_pos(lv_page_get_scrllable(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_scrl_fit2(ta, LV_FIT_MAX, LV_FIT_PARENT); lv_page_set_scrllable_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_scrl_fit2(ta, LV_FIT_PARENT, LV_FIT_PARENT); lv_page_set_scrllable_fit2(ta, LV_FIT_PARENT, LV_FIT_PARENT);
} }
} }
@ -1566,7 +1566,7 @@ static lv_style_list_t * lv_textarea_get_style(lv_obj_t * ta, uint8_t part)
case LV_TEXTAREA_PART_BG: case LV_TEXTAREA_PART_BG:
style_dsc_p = &ta->style_list; style_dsc_p = &ta->style_list;
break; break;
case LV_TEXTAREA_PART_SCRLBAR: case LV_TEXTAREA_PART_SCROLLBAR:
style_dsc_p = &ext->page.scrlbar.style; style_dsc_p = &ext->page.scrlbar.style;
break; break;
case LV_TEXTAREA_PART_CURSOR: case LV_TEXTAREA_PART_CURSOR:
@ -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_scrl(ta), false); lv_obj_set_drag(lv_page_get_scrllable(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_scrl(ta), true); lv_obj_set_drag(lv_page_get_scrllable(ta), true);
} }
} }

View File

@ -78,7 +78,7 @@ typedef struct {
/** Possible text areas tyles. */ /** Possible text areas tyles. */
enum { enum {
LV_TEXTAREA_PART_BG = LV_PAGE_PART_BG, /**< Text area background style */ LV_TEXTAREA_PART_BG = LV_PAGE_PART_BG, /**< Text area background style */
LV_TEXTAREA_PART_SCRLBAR = LV_PAGE_PART_SCROLLBAR, /**< Scrollbar style */ LV_TEXTAREA_PART_SCROLLBAR = LV_PAGE_PART_SCROLLBAR, /**< Scrollbar style */
LV_TEXTAREA_PART_EDGE_FLASH = LV_PAGE_PART_EDGE_FLASH, /**< Edge flash style */ LV_TEXTAREA_PART_EDGE_FLASH = LV_PAGE_PART_EDGE_FLASH, /**< Edge flash style */
LV_TEXTAREA_PART_CURSOR = _LV_PAGE_PART_VIRTUAL_LAST, /**< Cursor style */ LV_TEXTAREA_PART_CURSOR = _LV_PAGE_PART_VIRTUAL_LAST, /**< Cursor style */
LV_TEXTAREA_PART_PLACEHOLDER, /**< Placeholder style */ LV_TEXTAREA_PART_PLACEHOLDER, /**< Placeholder style */
@ -222,11 +222,11 @@ void lv_textarea_set_insert_replace(lv_obj_t * ta, const char * txt);
/** /**
* Set the scroll bar mode of a text area * Set the scroll bar mode of a text area
* @param ta pointer to a text area object * @param ta pointer to a text area object
* @param sb_mode the new mode from 'lv_page_sb_mode_t' enum * @param sb_mode the new mode from 'lv_scrollbar_mode_t' enum
*/ */
static inline void lv_textarea_set_sb_mode(lv_obj_t * ta, lv_scrlbar_mode_t mode) static inline void lv_textarea_set_sscrollbar_mode(lv_obj_t * ta, lv_scrollbar_mode_t mode)
{ {
lv_page_set_scrlbar_mode(ta, mode); lv_page_set_scrollbar_mode(ta, mode);
} }
/** /**
@ -348,11 +348,11 @@ uint16_t lv_textarea_get_max_length(lv_obj_t * ta);
/** /**
* Get the scroll bar mode of a text area * Get the scroll bar mode of a text area
* @param ta pointer to a text area object * @param ta pointer to a text area object
* @return scrollbar mode from 'lv_page_sb_mode_t' enum * @return scrollbar mode from 'lv_scrollbar_mode_t' enum
*/ */
static inline lv_scrlbar_mode_t lv_textarea_get_sb_mode(const lv_obj_t * ta) static inline lv_scrollbar_mode_t lv_textarea_get_scrollbar_mode(const lv_obj_t * ta)
{ {
return lv_page_get_sb_mode(ta); return lv_page_get_scrollbar_mode(ta);
} }
/** /**

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_scrl(new_tileview)); if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrllable(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_scrl(new_tileview), lv_tileview_scrl_signal); lv_obj_set_signal_cb(lv_page_get_scrllable(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_scrl(new_tileview), true); lv_obj_set_drag_throw(lv_page_get_scrllable(new_tileview), true);
lv_obj_set_drag_dir(lv_page_get_scrl(new_tileview), LV_DRAG_DIR_ONE); lv_obj_set_drag_dir(lv_page_get_scrllable(new_tileview), LV_DRAG_DIR_ONE);
lv_page_set_scrl_fit(new_tileview, LV_FIT_TIGHT); lv_page_set_scrllable_fit(new_tileview, LV_FIT_TIGHT);
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);
@ -227,7 +227,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_scrl(tileview); lv_obj_t * scrl = lv_page_get_scrllable(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);
@ -399,7 +399,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_scrl(tileview); lv_obj_t * scrl = lv_page_get_scrllable(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

@ -46,7 +46,7 @@ typedef struct {
/*Parts of the Tileview*/ /*Parts of the Tileview*/
enum { enum {
LV_TILEVIEW_PART_BG = LV_PAGE_PART_BG, LV_TILEVIEW_PART_BG = LV_PAGE_PART_BG,
LV_TILEVIEW_PART_SCRLBAR = LV_PAGE_PART_SCROLLBAR, LV_TILEVIEW_PART_SCROLLBAR = LV_PAGE_PART_SCROLLBAR,
LV_TILEVIEW_PART_EDGE_FLASH = LV_PAGE_PART_EDGE_FLASH, LV_TILEVIEW_PART_EDGE_FLASH = LV_PAGE_PART_EDGE_FLASH,
_LV_TILEVIEW_PART_VIRTUAL_LAST = _LV_PAGE_PART_VIRTUAL_LAST, _LV_TILEVIEW_PART_VIRTUAL_LAST = _LV_PAGE_PART_VIRTUAL_LAST,
_LV_TILEVIEW_PART_REAL_LAST = _LV_PAGE_PART_REAL_LAST _LV_TILEVIEW_PART_REAL_LAST = _LV_PAGE_PART_REAL_LAST

View File

@ -97,7 +97,7 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
ext->page = lv_page_create(new_win, NULL); ext->page = lv_page_create(new_win, NULL);
lv_obj_add_protect(ext->page, LV_PROTECT_PARENT); lv_obj_add_protect(ext->page, LV_PROTECT_PARENT);
lv_page_set_scrlbar_mode(ext->page, LV_SCRLBAR_MODE_AUTO); lv_page_set_scrollbar_mode(ext->page, LV_SCROLLBAR_MODE_AUTO);
lv_obj_clean_style_list(ext->page, LV_PAGE_PART_BG); lv_obj_clean_style_list(ext->page, LV_PAGE_PART_BG);
/*Create a holder for the header*/ /*Create a holder for the header*/
@ -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_scrl(win); lv_obj_t * scrl = lv_page_get_scrllable(win);
lv_obj_clean(scrl); lv_obj_clean(scrl);
} }
@ -293,12 +293,12 @@ void lv_win_set_layout(lv_obj_t * win, lv_layout_t layout)
* @param win pointer to a window object * @param win pointer to a window object
* @param sb_mode the new scroll bar mode from 'lv_sb_mode_t' * @param sb_mode the new scroll bar mode from 'lv_sb_mode_t'
*/ */
void lv_win_set_scrlbar_mode(lv_obj_t * win, lv_scrlbar_mode_t sb_mode) void lv_win_set_scrollbar_mode(lv_obj_t * win, lv_scrollbar_mode_t sb_mode)
{ {
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_page_set_scrlbar_mode(ext->page, sb_mode); lv_page_set_scrollbar_mode(ext->page, sb_mode);
} }
/** /**
* Set focus animation duration on `lv_win_focus()` * Set focus animation duration on `lv_win_focus()`
@ -418,12 +418,12 @@ lv_layout_t lv_win_get_layout(lv_obj_t * win)
* @param win pointer to a window object * @param win pointer to a window object
* @return the scroll bar mode of the window (from 'lv_sb_mode_t') * @return the scroll bar mode of the window (from 'lv_sb_mode_t')
*/ */
lv_scrlbar_mode_t lv_win_get_sb_mode(lv_obj_t * win) lv_scrollbar_mode_t lv_win_get_sb_mode(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);
return lv_page_get_sb_mode(ext->page); return lv_page_get_scrollbar_mode(ext->page);
} }
/** /**
@ -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_scrl(ext->page); lv_obj_t * scrl = lv_page_get_scrllable(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_scrl(ext->page), if(info->part == LV_WIN_PART_CONTENT_SCROLLABLE) info->result = lv_obj_get_state(lv_page_get_scrllable(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);

View File

@ -149,9 +149,9 @@ void lv_win_set_layout(lv_obj_t * win, lv_layout_t layout);
/** /**
* Set the scroll bar mode of a window * Set the scroll bar mode of a window
* @param win pointer to a window object * @param win pointer to a window object
* @param sb_mode the new scroll bar mode from 'lv_sb_mode_t' * @param sb_mode the new scroll bar mode from 'lv_scrollbar_mode_t'
*/ */
void lv_win_set_scrlbar_mode(lv_obj_t * win, lv_scrlbar_mode_t sb_mode); void lv_win_set_scrollbar_mode(lv_obj_t * win, lv_scrollbar_mode_t sb_mode);
/** /**
* Set focus animation duration on `lv_win_focus()` * Set focus animation duration on `lv_win_focus()`
@ -220,7 +220,7 @@ lv_layout_t lv_win_get_layout(lv_obj_t * win);
* @param win pointer to a window object * @param win pointer to a window object
* @return the scroll bar mode of the window (from 'lv_sb_mode_t') * @return the scroll bar mode of the window (from 'lv_sb_mode_t')
*/ */
lv_scrlbar_mode_t lv_win_get_sb_mode(lv_obj_t * win); lv_scrollbar_mode_t lv_win_get_sb_mode(lv_obj_t * win);
/** /**
* Get focus animation duration * Get focus animation duration

View File

@ -62,6 +62,8 @@ minimal_monochrome = {
"LV_ANTIALIAS":0, "LV_ANTIALIAS":0,
"LV_GPU":0, "LV_GPU":0,
"LV_USE_FILESYSTEM":0, "LV_USE_FILESYSTEM":0,
"LV_USE_IMG_TRANSFORM":0,
"LV_USE_API_EXTENSION_V6":0,
"LV_USE_USER_DATA":0, "LV_USE_USER_DATA":0,
"LV_USE_USER_DATA_FREE":0, "LV_USE_USER_DATA_FREE":0,
"LV_USE_LOG":0, "LV_USE_LOG":0,
@ -139,6 +141,8 @@ all_obj_minimal_features = {
"LV_ANTIALIAS":0, "LV_ANTIALIAS":0,
"LV_GPU":0, "LV_GPU":0,
"LV_USE_FILESYSTEM":0, "LV_USE_FILESYSTEM":0,
"LV_USE_IMG_TRANSFORM":0,
"LV_USE_API_EXTENSION_V6":0,
"LV_USE_USER_DATA":0, "LV_USE_USER_DATA":0,
"LV_USE_USER_DATA_FREE":0, "LV_USE_USER_DATA_FREE":0,
"LV_USE_LOG":0, "LV_USE_LOG":0,
@ -214,6 +218,8 @@ all_obj_all_features = {
"LV_ANTIALIAS":1, "LV_ANTIALIAS":1,
"LV_GPU":1, "LV_GPU":1,
"LV_USE_FILESYSTEM":1, "LV_USE_FILESYSTEM":1,
"LV_USE_IMG_TRANSFORM":1,
"LV_USE_API_EXTENSION_V6":1,
"LV_USE_USER_DATA":1, "LV_USE_USER_DATA":1,
"LV_USE_USER_DATA_FREE":0, "LV_USE_USER_DATA_FREE":0,
"LV_USE_LOG":1, "LV_USE_LOG":1,
@ -293,6 +299,8 @@ advanced_features = {
"LV_ANTIALIAS":1, "LV_ANTIALIAS":1,
"LV_GPU":1, "LV_GPU":1,
"LV_USE_FILESYSTEM":1, "LV_USE_FILESYSTEM":1,
"LV_USE_IMG_TRANSFORM":1,
"LV_USE_API_EXTENSION_V6":1,
"LV_USE_USER_DATA":1, "LV_USE_USER_DATA":1,
"LV_USE_USER_DATA_FREE":1, "LV_USE_USER_DATA_FREE":1,
"LV_USER_DATA_FREE_INCLUDE":"\\\"<stdio.h>\\\"", "LV_USER_DATA_FREE_INCLUDE":"\\\"<stdio.h>\\\"",