diff --git a/src/lv_objx/lv_imgbtn.c b/src/lv_objx/lv_imgbtn.c index 58a03b1c6..952644087 100644 --- a/src/lv_objx/lv_imgbtn.c +++ b/src/lv_objx/lv_imgbtn.c @@ -281,7 +281,7 @@ static bool lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * mask, lv_desig src = ext->img_src_left[state]; if(src) { - lv_img_dsc_get_info(src, &header); + lv_img_decoder_get_info(src, &header); left_w = header.w; coords.x1 = imgbtn->coords.x1; coords.y1 = imgbtn->coords.y1; @@ -292,7 +292,7 @@ static bool lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * mask, lv_desig src = ext->img_src_right[state]; if(src) { - lv_img_dsc_get_info(src, &header); + lv_img_decoder_get_info(src, &header); right_w = header.w; coords.x1 = imgbtn->coords.x2 - header.w + 1; coords.y1 = imgbtn->coords.y1; @@ -305,7 +305,7 @@ static bool lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * mask, lv_desig if(src) { lv_coord_t obj_w = lv_obj_get_width(imgbtn); lv_coord_t i; - lv_img_dsc_get_info(src, &header); + lv_img_decoder_get_info(src, &header); coords.x1 = imgbtn->coords.x1 + left_w; coords.y1 = imgbtn->coords.y1; diff --git a/src/lv_objx/lv_page.c b/src/lv_objx/lv_page.c index e07b04dac..361e33977 100644 --- a/src/lv_objx/lv_page.c +++ b/src/lv_objx/lv_page.c @@ -1124,15 +1124,16 @@ static void lv_page_sb_refresh(lv_obj_t * page) return; } - /*Horizontal scrollbar*/ + /*Full sized horizontal scrollbar*/ if(scrl_w <= - obj_w - style->body.padding.left - style->body.padding.right) { /*Full sized scroll bar*/ + obj_w - style->body.padding.left - style->body.padding.right) { lv_area_set_width(&ext->sb.hor_area, obj_w - 2 * sb_hor_pad); lv_area_set_pos(&ext->sb.hor_area, sb_hor_pad, - obj_h - ext->sb.style->body.padding.inner - - ext->sb.style->body.padding.bottom); + obj_h - ext->sb.style->body.padding.inner - ext->sb.style->body.padding.bottom); if(ext->sb.mode == LV_SB_MODE_AUTO || ext->sb.mode == LV_SB_MODE_DRAG) ext->sb.hor_draw = 0; - } else { + } + /*Smaller horizontal scrollbar*/ + else { size_tmp = (obj_w * (obj_w - (2 * sb_hor_pad))) / (scrl_w + style->body.padding.left + style->body.padding.right); if(size_tmp < LV_PAGE_SB_MIN_SIZE) size_tmp = LV_PAGE_SB_MIN_SIZE; @@ -1149,16 +1150,16 @@ static void lv_page_sb_refresh(lv_obj_t * page) if(ext->sb.mode == LV_SB_MODE_AUTO || ext->sb.mode == LV_SB_MODE_DRAG) ext->sb.hor_draw = 1; } - /*Vertical scrollbar*/ - if(scrl_h <= - obj_h - style->body.padding.top - style->body.padding.bottom) { /*Full sized scroll bar*/ + /*Full sized vertical scroll bar*/ + if(scrl_h <= obj_h - style->body.padding.top - style->body.padding.bottom) { lv_area_set_height(&ext->sb.ver_area, obj_h - 2 * sb_ver_pad); lv_area_set_pos(&ext->sb.ver_area, - obj_w - ext->sb.style->body.padding.inner - - ext->sb.style->body.padding.right, + obj_w - ext->sb.style->body.padding.inner - ext->sb.style->body.padding.right, sb_ver_pad); if(ext->sb.mode == LV_SB_MODE_AUTO || ext->sb.mode == LV_SB_MODE_DRAG) ext->sb.ver_draw = 0; - } else { + } + /*Smaller vertical scroll bar*/ + else { size_tmp = (obj_h * (obj_h - (2 * sb_ver_pad))) / (scrl_h + style->body.padding.top + style->body.padding.bottom); if(size_tmp < LV_PAGE_SB_MIN_SIZE) size_tmp = LV_PAGE_SB_MIN_SIZE; @@ -1166,7 +1167,7 @@ static void lv_page_sb_refresh(lv_obj_t * page) lv_area_set_pos( &ext->sb.ver_area, - obj_w - ext->sb.style->body.padding.inner - ext->sb.style->body.padding.bottom, + obj_w - ext->sb.style->body.padding.inner - ext->sb.style->body.padding.right, sb_ver_pad + (-(lv_obj_get_y(scrl) - ext->sb.style->body.padding.bottom) * (obj_h - size_tmp - 2 * sb_ver_pad)) /