Merge branch 'feat-new-style' of https://github.com/littlevgl/lvgl into feat-new-style

This commit is contained in:
Gabor Kiss-Vamosi
2020-01-09 14:16:58 +01:00
4 changed files with 8 additions and 7 deletions

View File

@@ -2037,7 +2037,6 @@ lv_style_int_t lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_style
lv_style_attr_t attr;
attr.full = prop >> 8;
int16_t weight = -1;
lv_style_int_t value;
lv_res_t res = LV_RES_INV;
const lv_obj_t * parent = obj;
@@ -2717,7 +2716,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
draw_dsc->border_part = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_PART);
draw_dsc->border_color = lv_obj_get_style_color(obj, part, LV_STYLE_BORDER_COLOR);
}
draw_dsc->bg_blend_mode = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_BLEND_MODE);
draw_dsc->border_blend_mode = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_BLEND_MODE);
}
draw_dsc->pattern_src = lv_obj_get_style_ptr(obj, part, LV_STYLE_PATTERN_IMAGE);

View File

@@ -441,7 +441,7 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
}
}
/*If no better children check this object*/
/*If no better children use this object*/
if(found_p == NULL) {
if(design_res == LV_DESIGN_RES_COVER) {
found_p = obj;

View File

@@ -372,6 +372,7 @@ uint32_t prop_fooled[256];
lv_res_t lv_style_dsc_get_int(lv_style_dsc_t * dsc, lv_style_property_t prop, lv_style_int_t * value)
{
if(dsc == NULL) return LV_RES_INV;
if(dsc->local.map == NULL && dsc->classes == NULL) return LV_RES_INV;
lv_res_t res = LV_RES_OK;
@@ -478,6 +479,7 @@ lv_res_t lv_style_dsc_get_int(lv_style_dsc_t * dsc, lv_style_property_t prop, lv
lv_res_t lv_style_dsc_get_color(lv_style_dsc_t * dsc, lv_style_property_t prop, lv_color_t * value)
{
if(dsc == NULL) return LV_RES_INV;
if(dsc->local.map == NULL && dsc->classes == NULL) return LV_RES_INV;
lv_res_t res = LV_RES_OK;
@@ -540,6 +542,7 @@ lv_res_t lv_style_dsc_get_color(lv_style_dsc_t * dsc, lv_style_property_t prop,
lv_res_t lv_style_dsc_get_opa(lv_style_dsc_t * dsc, lv_style_property_t prop, lv_opa_t * value)
{
if(dsc == NULL) return LV_RES_INV;
if(dsc->local.map == NULL && dsc->classes == NULL) return LV_RES_INV;
volatile lv_res_t res = LV_RES_OK;
@@ -630,6 +633,7 @@ lv_res_t lv_style_dsc_get_opa(lv_style_dsc_t * dsc, lv_style_property_t prop, lv
lv_res_t lv_style_dsc_get_ptr(lv_style_dsc_t * dsc, lv_style_property_t prop, void ** value)
{
if(dsc == NULL) return LV_RES_INV;
if(dsc->local.map == NULL && dsc->classes == NULL) return LV_RES_INV;
lv_res_t res = LV_RES_OK;
@@ -653,7 +657,7 @@ lv_res_t lv_style_dsc_get_ptr(lv_style_dsc_t * dsc, lv_style_property_t prop, vo
int16_t weight_act;
int16_t weight = -1;
void * value_act;
void * value_act = NULL;
weight_act = lv_style_get_ptr(&dsc->local, prop, &value_act);
/*On perfect match return the value immediately*/

View File

@@ -123,9 +123,7 @@ static void basic_init(void)
lv_style_set_ptr(&btn, LV_STYLE_FONT | LV_STYLE_STATE_PRESSED, &lv_font_roboto_28);
lv_style_set_opa(&btn, LV_STYLE_BG_OPA, LV_OPA_50);
lv_style_set_opa(&btn, LV_STYLE_BORDER_OPA, LV_OPA_70);
// lv_style_set_opa(&btn, LV_STYLE_TEXT_OPA, LV_OPA_50);
// lv_style_set_value(&btn, LV_STYLE_SHADOW_WIDTH, 5);
// lv_style_set_value(&btn, LV_STYLE_SHADOW_OFFSET_Y, 10);
lv_style_set_opa(&btn, LV_STYLE_TEXT_OPA, LV_OPA_50);
lv_style_set_int(&btn, LV_STYLE_BORDER_WIDTH | LV_STYLE_STATE_FOCUS, 6);
lv_style_set_ptr(&btn, LV_STYLE_PATTERN_IMAGE | LV_STYLE_STATE_CHECKED, LV_SYMBOL_OK);
lv_style_set_int(&btn, LV_STYLE_PATTERN_REPEATE | LV_STYLE_STATE_CHECKED, 1);