api(style) add lv_style_selector_t instead of lv_part_t and lv_state_t in style API
This commit is contained in:
@@ -12,7 +12,7 @@ void lv_example_label_1(void)
|
||||
lv_label_set_text(label1, "#0000ff Re-color# #ff00ff words# #ff0000 of a# label, align the lines to the center"
|
||||
"and wrap long text automatically.");
|
||||
lv_obj_set_width(label1, 150); /*Set smaller width to make the lines wrap*/
|
||||
lv_obj_set_style_text_align(label1, LV_PART_MAIN, LV_STATE_DEFAULT, LV_TEXT_ALIGN_CENTER);
|
||||
lv_obj_set_style_text_align(label1, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_obj_align(label1, LV_ALIGN_CENTER, 0, -40);
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ void lv_example_label_2(void)
|
||||
|
||||
/*Create a label for the shadow first (it's in the background)*/
|
||||
lv_obj_t * shadow_label = lv_label_create(lv_scr_act());
|
||||
lv_obj_add_style(shadow_label, LV_PART_MAIN, LV_STATE_DEFAULT, &style_shadow);
|
||||
lv_obj_add_style(shadow_label, &style_shadow, 0);
|
||||
|
||||
/*Create the main label*/
|
||||
lv_obj_t * main_label = lv_label_create(lv_scr_act());
|
||||
|
||||
Reference in New Issue
Block a user