make bg_opa:transp the deafult
This commit is contained in:
@@ -1809,7 +1809,7 @@ void lv_obj_get_inner_coords(const lv_obj_t * obj, lv_area_t * coords_p)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||
|
||||
lv_border_side_t part = lv_obj_get_style_int(obj, LV_OBJ_PART_MAIN, LV_STYLE_BORDER_PART);
|
||||
lv_border_side_t part = lv_obj_get_style_int(obj, LV_OBJ_PART_MAIN, LV_STYLE_BORDER_SIDE);
|
||||
lv_coord_t w = lv_obj_get_style_int(obj, LV_OBJ_PART_MAIN, LV_STYLE_BORDER_WIDTH);
|
||||
|
||||
if(part & LV_BORDER_SIDE_LEFT) coords_p->x1 += w;
|
||||
@@ -2072,7 +2072,7 @@ lv_style_int_t lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_style
|
||||
|
||||
prop = prop & (~LV_STYLE_STATE_MASK);
|
||||
switch(prop) {
|
||||
case LV_STYLE_BORDER_PART:
|
||||
case LV_STYLE_BORDER_SIDE:
|
||||
return LV_BORDER_SIDE_FULL;
|
||||
case LV_STYLE_SIZE:
|
||||
return LV_DPI / 10;
|
||||
@@ -2118,11 +2118,9 @@ lv_color_t lv_obj_get_style_color(const lv_obj_t * obj, uint8_t part, lv_style_p
|
||||
prop = prop & (~LV_STYLE_STATE_MASK);
|
||||
switch(prop) {
|
||||
case LV_STYLE_TEXT_COLOR:
|
||||
return LV_COLOR_BLACK;
|
||||
case LV_STYLE_BORDER_COLOR:
|
||||
return LV_COLOR_BLACK;
|
||||
case LV_STYLE_SHADOW_COLOR:
|
||||
return LV_COLOR_GRAY;
|
||||
return LV_COLOR_BLACK;
|
||||
}
|
||||
|
||||
return LV_COLOR_WHITE;
|
||||
@@ -2161,13 +2159,15 @@ lv_opa_t lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prope
|
||||
|
||||
prop = prop & (~LV_STYLE_STATE_MASK);
|
||||
switch(prop) {
|
||||
case LV_STYLE_OVERLAY_OPA:
|
||||
case LV_STYLE_PATTERN_RECOLOR_OPA:
|
||||
case LV_STYLE_IMAGE_RECOLOR_OPA:
|
||||
return LV_OPA_TRANSP;
|
||||
case LV_STYLE_OPA_SCALE:
|
||||
case LV_STYLE_TEXT_OPA:
|
||||
case LV_STYLE_IMAGE_OPA:
|
||||
case LV_STYLE_LINE_OPA:
|
||||
case LV_STYLE_BORDER_OPA:
|
||||
return LV_OPA_COVER;
|
||||
}
|
||||
|
||||
return LV_OPA_COVER;
|
||||
return LV_OPA_TRANSP;
|
||||
}
|
||||
|
||||
|
||||
@@ -2727,7 +2727,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
if(draw_dsc->border_opa > LV_OPA_MIN) {
|
||||
draw_dsc->border_width = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_WIDTH);
|
||||
if(draw_dsc->border_width) {
|
||||
draw_dsc->border_part = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_PART);
|
||||
draw_dsc->border_part = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_SIDE);
|
||||
draw_dsc->border_color = lv_obj_get_style_color(obj, part, LV_STYLE_BORDER_COLOR);
|
||||
}
|
||||
draw_dsc->border_blend_mode = lv_obj_get_style_int(obj, part, LV_STYLE_BORDER_BLEND_MODE);
|
||||
|
||||
@@ -93,7 +93,7 @@ enum {
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BG_OPA, 0x2, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
||||
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BORDER_WIDTH, 0x3, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BORDER_PART, 0x3, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BORDER_SIDE, 0x3, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BORDER_BLEND_MODE, 0x3, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BORDER_COLOR, 0x3, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
||||
LV_STYLE_PROP_INIT(LV_STYLE_BORDER_OPA, 0x3, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
||||
|
||||
@@ -81,6 +81,7 @@ static lv_style_t calendar_date_nums;
|
||||
static void basic_init(void)
|
||||
{
|
||||
lv_style_init(&scr);
|
||||
lv_style_set_opa(&scr, LV_STYLE_BG_OPA, LV_OPA_COVER);
|
||||
lv_style_set_color(&scr, LV_STYLE_BG_COLOR, LV_COLOR_MAKE(0x20, 0x20, 0x20));
|
||||
lv_style_set_color(&scr, LV_STYLE_TEXT_COLOR , LV_COLOR_WHITE);
|
||||
|
||||
@@ -89,6 +90,7 @@ static void basic_init(void)
|
||||
lv_style_set_int(&transp, LV_STYLE_BORDER_WIDTH, 0);
|
||||
|
||||
lv_style_init(&panel);
|
||||
lv_style_set_opa(&panel, LV_STYLE_BG_OPA, LV_OPA_COVER);
|
||||
lv_style_set_int(&panel, LV_STYLE_PAD_LEFT, LV_DPI / 20);
|
||||
lv_style_set_int(&panel, LV_STYLE_PAD_RIGHT, LV_DPI / 20);
|
||||
lv_style_set_int(&panel, LV_STYLE_PAD_TOP, LV_DPI / 20);
|
||||
@@ -109,6 +111,7 @@ static void basic_init(void)
|
||||
lv_style_set_int(&btn, LV_STYLE_PAD_BOTTOM, LV_DPI / 20);
|
||||
lv_style_set_int(&btn, LV_STYLE_PAD_INNER, LV_DPI / 16);
|
||||
lv_style_set_int(&btn, LV_STYLE_RADIUS, 5);
|
||||
lv_style_set_opa(&btn, LV_STYLE_BG_OPA, LV_OPA_COVER);
|
||||
lv_style_set_int(&btn, LV_STYLE_BORDER_WIDTH, 2);//LV_DPI / 50 > 0 ? LV_DPI / 50 : 1);
|
||||
lv_style_set_int(&btn, LV_STYLE_BG_GRAD_DIR, LV_GRAD_DIR_VER);
|
||||
lv_style_set_color(&btn, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
@@ -238,7 +241,8 @@ static void bar_init(void)
|
||||
{
|
||||
#if LV_USE_BAR
|
||||
lv_style_init(&bar_indic);
|
||||
lv_style_set_color(&bar_indic, LV_STYLE_BG_COLOR, LV_COLOR_BLUE);
|
||||
lv_style_set_opa(&bar_indic, LV_STYLE_BG_OPA, LV_OPA_COVER);
|
||||
lv_style_set_color(&bar_indic, LV_STYLE_BG_COLOR, LV_COLOR_MAROON);
|
||||
lv_style_set_int(&bar_indic, LV_STYLE_PAD_TOP, LV_DPI/20);
|
||||
lv_style_set_int(&bar_indic, LV_STYLE_PAD_BOTTOM, LV_DPI/20);
|
||||
lv_style_set_int(&bar_indic, LV_STYLE_PAD_LEFT, LV_DPI/20);
|
||||
@@ -271,6 +275,7 @@ static void slider_init(void)
|
||||
{
|
||||
#if LV_USE_SLIDER != 0
|
||||
lv_style_init(&knob);
|
||||
lv_style_set_opa(&knob, LV_STYLE_BG_OPA, LV_OPA_COVER);
|
||||
lv_style_set_color(&knob, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&knob, LV_STYLE_BG_COLOR | LV_STYLE_STATE_CHECKED, LV_COLOR_LIME);
|
||||
lv_style_set_int(&knob, LV_STYLE_PAD_TOP, LV_DPI/20);
|
||||
@@ -354,7 +359,7 @@ static void calendar_init(void)
|
||||
lv_style_init(&calendar_date_nums);
|
||||
lv_style_set_color(&calendar_date_nums, LV_STYLE_TEXT_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&calendar_date_nums, LV_STYLE_TEXT_COLOR | LV_STYLE_STATE_DISABLED, LV_COLOR_GRAY);
|
||||
lv_style_set_color(&calendar_date_nums, LV_STYLE_TEXT_COLOR | LV_STYLE_STATE_PRESSED, LV_COLOR_GRAY);
|
||||
// lv_style_set_color(&calendar_date_nums, LV_STYLE_TEXT_COLOR | LV_STYLE_STATE_PRESSED, LV_COLOR_GRAY);
|
||||
lv_style_set_color(&calendar_date_nums, LV_STYLE_TEXT_COLOR | LV_STYLE_STATE_CHECKED, LV_COLOR_NAVY);
|
||||
|
||||
lv_style_set_opa(&calendar_date_nums, LV_STYLE_BG_OPA , LV_OPA_TRANSP);
|
||||
@@ -363,7 +368,7 @@ static void calendar_init(void)
|
||||
lv_style_set_opa(&calendar_date_nums, LV_STYLE_BG_OPA | LV_STYLE_STATE_PRESSED , LV_OPA_50);
|
||||
lv_style_set_color(&calendar_date_nums, LV_STYLE_BG_COLOR | LV_STYLE_STATE_CHECKED, LV_COLOR_GREEN);
|
||||
lv_style_set_int(&calendar_date_nums, LV_STYLE_BORDER_WIDTH | LV_STYLE_STATE_CHECKED , 2);
|
||||
lv_style_set_int(&calendar_date_nums, LV_STYLE_BORDER_PART| LV_STYLE_STATE_CHECKED , LV_BORDER_SIDE_LEFT);
|
||||
lv_style_set_int(&calendar_date_nums, LV_STYLE_BORDER_SIDE| LV_STYLE_STATE_CHECKED , LV_BORDER_SIDE_LEFT);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -439,13 +444,14 @@ static void ta_init(void)
|
||||
{
|
||||
#if LV_USE_TA
|
||||
lv_style_init(&ta_cursor);
|
||||
lv_style_set_opa(&ta_cursor, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||
lv_style_set_color(&ta_cursor, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||
lv_style_set_color(&ta_cursor, LV_STYLE_BORDER_COLOR, LV_COLOR_YELLOW);
|
||||
lv_style_set_color(&ta_cursor, LV_STYLE_TEXT_COLOR, LV_COLOR_WHITE);
|
||||
lv_style_set_int(&ta_cursor, LV_STYLE_BORDER_WIDTH, 2);
|
||||
lv_style_set_int(&ta_cursor, LV_STYLE_BORDER_WIDTH, 2);
|
||||
lv_style_set_int(&ta_cursor, LV_STYLE_PAD_RIGHT, 2);
|
||||
lv_style_set_int(&ta_cursor, LV_STYLE_BORDER_PART, LV_BORDER_SIDE_LEFT);
|
||||
lv_style_set_int(&ta_cursor, LV_STYLE_BORDER_SIDE, LV_BORDER_SIDE_LEFT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user