diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 0c297f573..7bec119a2 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -318,6 +318,8 @@ lv_res_t lv_indev_finish_drag(lv_indev_t * indev) res = lv_event_send(drag_obj, LV_EVENT_DRAG_END, NULL); if(res != LV_RES_OK) return res; + + return res; } /** @@ -1178,22 +1180,22 @@ static void indev_drag(lv_indev_proc_t * proc) act_y += proc->types.pointer.drag_sum.y; } } + } - /*In the inactive direction `drag_sum` is kept zero*/ - if(proc->types.pointer.drag_sum.x) act_x += proc->types.pointer.vect.x; - if(proc->types.pointer.drag_sum.y) act_y += proc->types.pointer.vect.y; - lv_obj_set_pos(drag_obj, act_x, act_y); - proc->types.pointer.drag_in_prog = 1; + /*In the inactive direction `drag_sum` is kept zero*/ + if(proc->types.pointer.drag_sum.x) act_x += proc->types.pointer.vect.x; + if(proc->types.pointer.drag_sum.y) act_y += proc->types.pointer.vect.y; + lv_obj_set_pos(drag_obj, act_x, act_y); + proc->types.pointer.drag_in_prog = 1; - /*Set the drag in progress flag*/ - /*Send the drag begin signal on first move*/ - if(drag_just_started) { - drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_BEGIN, indev_act); - if(indev_reset_check(proc)) return; + /*Set the drag in progress flag*/ + /*Send the drag begin signal on first move*/ + if(drag_just_started) { + drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_BEGIN, indev_act); + if(indev_reset_check(proc)) return; - lv_event_send(drag_obj, LV_EVENT_DRAG_BEGIN, NULL); - if(indev_reset_check(proc)) return; - } + lv_event_send(drag_obj, LV_EVENT_DRAG_BEGIN, NULL); + if(indev_reset_check(proc)) return; } /*If the object didn't moved then clear the invalidated areas*/ @@ -1228,7 +1230,6 @@ static void indev_drag_throw(lv_indev_proc_t * proc) if(lv_obj_get_drag_throw(drag_obj) == false) { proc->types.pointer.drag_in_prog = 0; drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_END, indev_act); - lv_event_send(drag_obj, LV_EVENT_DRAG_END, NULL); if(indev_reset_check(proc)) return; lv_event_send(drag_obj, LV_EVENT_DRAG_END, NULL); diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index f712acf0d..edcf7d5c6 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -196,7 +196,6 @@ void lv_style_init(void) lv_style_btn_rel.body.border.color = lv_color_make(0x0b, 0x19, 0x28); lv_style_btn_rel.body.border.width = LV_DPI / 50 >= 1 ? LV_DPI / 50 : 1; lv_style_btn_rel.body.border.opa = LV_OPA_70; - lv_style_btn_rel.body.border.part = LV_BORDER_PART_BOTTOM; lv_style_btn_rel.body.shadow.color = LV_COLOR_BLACK; lv_style_btn_rel.body.shadow.width = 0; lv_style_btn_rel.body.shadow.opa = LV_OPA_COVER; diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index b2093e648..c042d6b8b 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -302,10 +302,10 @@ static void draw_border(const lv_area_t * coords, const lv_area_t * clip, const /*Get the inner area*/ lv_area_t area_small; lv_area_copy(&area_small, coords); - area_small.x1 += ((style->body.border.part & LV_BORDER_PART_LEFT) ? border_width : -border_width); - area_small.x2 -= ((style->body.border.part & LV_BORDER_PART_RIGHT) ? border_width : -border_width); - area_small.y1 += ((style->body.border.part & LV_BORDER_PART_TOP) ? border_width : -border_width); - area_small.y2 -= ((style->body.border.part & LV_BORDER_PART_BOTTOM) ? border_width : -border_width); + area_small.x1 += ((style->body.border.part & LV_BORDER_PART_LEFT) ? border_width : - (border_width + rout)); + area_small.x2 -= ((style->body.border.part & LV_BORDER_PART_RIGHT) ? border_width : - (border_width + rout)); + area_small.y1 += ((style->body.border.part & LV_BORDER_PART_TOP) ? border_width : - (border_width + rout)); + area_small.y2 -= ((style->body.border.part & LV_BORDER_PART_BOTTOM) ? border_width : - (border_width + rout)); /*Create inner the mask*/ lv_draw_mask_radius_init(&mask_rin_param, &area_small, rout - border_width, true); diff --git a/src/lv_objx/lv_label.h b/src/lv_objx/lv_label.h index 3faa04ecd..faa21684f 100644 --- a/src/lv_objx/lv_label.h +++ b/src/lv_objx/lv_label.h @@ -33,7 +33,7 @@ extern "C" { *********************/ #define LV_LABEL_DOT_NUM 3 #define LV_LABEL_POS_LAST 0xFFFF -#define LV_LABEL_TEXT_SEL_OFF 0 +#define LV_LABEL_TEXT_SEL_OFF LV_DRAW_LABEL_NO_TXT_SEL LV_EXPORT_CONST_INT(LV_LABEL_DOT_NUM); LV_EXPORT_CONST_INT(LV_LABEL_POS_LAST); diff --git a/src/lv_objx/lv_tabview.c b/src/lv_objx/lv_tabview.c index 6c1aba058..4b6a2dcfa 100644 --- a/src/lv_objx/lv_tabview.c +++ b/src/lv_objx/lv_tabview.c @@ -468,14 +468,6 @@ void lv_tabview_set_style(lv_obj_t * tabview, lv_tabview_style_t type, const lv_ case LV_TABVIEW_STYLE_BTN_TGL_PR: lv_btnm_set_style(ext->btns, LV_BTNM_STYLE_BTN_TGL_PR, style); break; case LV_TABVIEW_STYLE_INDIC: lv_obj_set_style(ext->indic, style); - - switch(ext->btns_pos) { - case LV_TABVIEW_BTNS_POS_TOP: - case LV_TABVIEW_BTNS_POS_BOTTOM: lv_obj_set_height(ext->indic, style->body.padding.inner); break; - case LV_TABVIEW_BTNS_POS_LEFT: - case LV_TABVIEW_BTNS_POS_RIGHT: lv_obj_set_width(ext->indic, style->body.padding.inner); break; - } - tabview_realign(tabview); break; } @@ -803,6 +795,10 @@ static void refr_indic_size(lv_obj_t * tabview) lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview); const lv_style_t * style_btn_bg = lv_tabview_get_style(tabview, LV_TABVIEW_STYLE_BTN_BG); + const lv_style_t * style_indic = lv_tabview_get_style(tabview, LV_TABVIEW_STYLE_INDIC); + + if(style_indic == NULL) style_indic = &lv_style_plain_color; + /*Set the indicator width/height*/ lv_coord_t indic_w; @@ -817,7 +813,7 @@ static void refr_indic_size(lv_obj_t * tabview) case LV_TABVIEW_BTNS_POS_BOTTOM: lv_obj_set_hidden(ext->indic, false); if(ext->tab_cnt) { - indic_h = style_btn_bg->body.padding.inner; + indic_h = style_indic->body.padding.inner; indic_w = (lv_obj_get_width(tabview) - style_btn_bg->body.padding.inner * (ext->tab_cnt - 1) - style_btn_bg->body.padding.left - style_btn_bg->body.padding.right) / ext->tab_cnt; @@ -830,7 +826,7 @@ static void refr_indic_size(lv_obj_t * tabview) case LV_TABVIEW_BTNS_POS_RIGHT: lv_obj_set_hidden(ext->indic, false); if(ext->tab_cnt) { - indic_w = style_btn_bg->body.padding.inner; + indic_w = style_indic->body.padding.inner; max_h = lv_obj_get_height(ext->btns) - style_btn_bg->body.padding.top - style_btn_bg->body.padding.bottom; indic_h= max_h - ((ext->tab_cnt - 1) * style_btn_bg->body.padding.inner); indic_h = indic_h / ext->tab_cnt; diff --git a/src/lv_themes/lv_theme_material.c b/src/lv_themes/lv_theme_material.c index 935aca7cd..7f792965d 100644 --- a/src/lv_themes/lv_theme_material.c +++ b/src/lv_themes/lv_theme_material.c @@ -14,7 +14,7 @@ * DEFINES *********************/ #define DEF_RADIUS 4 -#define DEF_SHADOW_COLOR lv_color_hex3(0xaaa) +#define DEF_SHADOW_COLOR lv_color_hex3(0x888) /********************** * TYPEDEFS @@ -117,6 +117,7 @@ static void btn_init(void) rel.body.padding.inner = LV_DPI / 10; rel.body.shadow.color = DEF_SHADOW_COLOR; rel.body.shadow.width = 6; + rel.body.shadow.offset.y = 2; rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 95); rel.image.color = lv_color_hsv_to_rgb(_hue, 5, 95); @@ -268,10 +269,13 @@ static void sw_init(void) lv_style_copy(&sw_indic, theme.style.slider.bg); sw_indic.body.radius = LV_RADIUS_CIRCLE; + sw_indic.body.padding.left = 0; + sw_indic.body.padding.right = 0; lv_style_copy(&sw_knob_on, theme.style.slider.knob); - sw_knob_on.body.shadow.width = 3; + sw_knob_on.body.shadow.width = 5; sw_knob_on.body.shadow.color = DEF_SHADOW_COLOR; + sw_knob_on.body.shadow.offset.y= 3; lv_style_copy(&sw_knob_off, &sw_knob_on); sw_knob_off.body.main_color = lv_color_hex(0xfafafa); @@ -672,6 +676,7 @@ static void tabview_init(void) indic.body.radius = 0; indic.body.border.width = 0; indic.body.padding.inner = LV_DPI / 20; + indic.body.padding.inner = LV_DPI / 20; lv_style_copy(&btn_bg, &def); btn_bg.body.main_color = lv_color_hex3(0xccc);