refactor: scr -> screen, act->active, del->delete, remove in obj_clear_flag/state
This commit is contained in:
@@ -21,7 +21,7 @@ void lv_example_style_1(void)
|
||||
lv_style_set_y(&style, 80);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
|
||||
lv_obj_t * label = lv_label_create(obj);
|
||||
|
||||
@@ -16,7 +16,7 @@ style.set_x(lv.pct(50))
|
||||
style.set_y(80)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
|
||||
label = lv.label(obj)
|
||||
|
||||
@@ -30,7 +30,7 @@ void lv_example_style_10(void)
|
||||
lv_style_set_transition(&style_pr, &trans_pr);
|
||||
|
||||
/*Create an object with the new style_pr*/
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style_def, 0);
|
||||
lv_obj_add_style(obj, &style_pr, LV_STATE_PRESSED);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ style_pr.set_border_color(lv.palette_darken(lv.PALETTE.RED, 3))
|
||||
style_pr.set_transition(trans_pr)
|
||||
|
||||
# Create an object with the new style_pr
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style_def, 0)
|
||||
obj.add_style(style_pr, lv.STATE.PRESSED)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ void lv_example_style_11(void)
|
||||
lv_style_set_text_color(&style_warning, lv_palette_darken(LV_PALETTE_YELLOW, 4));
|
||||
|
||||
/*Create an object with the base style only*/
|
||||
lv_obj_t * obj_base = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj_base = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj_base, &style_base, 0);
|
||||
lv_obj_align(obj_base, LV_ALIGN_LEFT_MID, 20, 0);
|
||||
|
||||
@@ -37,7 +37,7 @@ void lv_example_style_11(void)
|
||||
lv_obj_center(label);
|
||||
|
||||
/*Create another object with the base style and earnings style too*/
|
||||
lv_obj_t * obj_warning = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj_warning = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj_warning, &style_base, 0);
|
||||
lv_obj_add_style(obj_warning, &style_warning, 0);
|
||||
lv_obj_align(obj_warning, LV_ALIGN_RIGHT_MID, -20, 0);
|
||||
|
||||
@@ -24,7 +24,7 @@ style_warning.set_border_color(lv.palette_darken(lv.PALETTE.YELLOW, 3))
|
||||
style_warning.set_text_color(lv.palette_darken(lv.PALETTE.YELLOW, 4))
|
||||
|
||||
# Create an object with the base style only
|
||||
obj_base = lv.obj(lv.scr_act())
|
||||
obj_base = lv.obj(lv.screen_active())
|
||||
obj_base.add_style(style_base, 0)
|
||||
obj_base.align(lv.ALIGN.LEFT_MID, 20, 0)
|
||||
|
||||
@@ -33,7 +33,7 @@ label.set_text("Base")
|
||||
label.center()
|
||||
|
||||
# Create another object with the base style and earnings style too
|
||||
obj_warning = lv.obj(lv.scr_act())
|
||||
obj_warning = lv.obj(lv.screen_active())
|
||||
obj_warning.add_style(style_base, 0)
|
||||
obj_warning.add_style(style_warning, 0)
|
||||
obj_warning.align(lv.ALIGN.RIGHT_MID, -20, 0)
|
||||
|
||||
@@ -12,7 +12,7 @@ void lv_example_style_12(void)
|
||||
lv_style_set_border_color(&style, lv_palette_lighten(LV_PALETTE_GREEN, 3));
|
||||
lv_style_set_border_width(&style, 3);
|
||||
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
|
||||
/*Overwrite the background color locally*/
|
||||
|
||||
@@ -8,7 +8,7 @@ style.set_bg_color(lv.palette_main(lv.PALETTE.GREEN))
|
||||
style.set_border_color(lv.palette_lighten(lv.PALETTE.GREEN, 3))
|
||||
style.set_border_width(3)
|
||||
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
|
||||
# Overwrite the background color locally
|
||||
|
||||
@@ -19,7 +19,7 @@ void lv_example_style_13(void)
|
||||
lv_style_set_shadow_spread(&style_indic_pr, 3);
|
||||
|
||||
/*Create an object with the new style_pr*/
|
||||
lv_obj_t * obj = lv_slider_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_slider_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style_indic, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &style_indic_pr, LV_PART_INDICATOR | LV_STATE_PRESSED);
|
||||
lv_slider_set_value(obj, 70, LV_ANIM_OFF);
|
||||
|
||||
@@ -15,7 +15,7 @@ style_indic_pr.set_shadow_width(10)
|
||||
style_indic_pr.set_shadow_spread(3)
|
||||
|
||||
# Create an object with the new style_pr
|
||||
obj = lv.slider(lv.scr_act())
|
||||
obj = lv.slider(lv.screen_active())
|
||||
obj.add_style(style_indic, lv.PART.INDICATOR)
|
||||
obj.add_style(style_indic_pr, lv.PART.INDICATOR | lv.STATE.PRESSED)
|
||||
obj.set_value(70, lv.ANIM.OFF)
|
||||
|
||||
@@ -46,7 +46,7 @@ void lv_example_style_14(void)
|
||||
lv_obj_t * btn;
|
||||
lv_obj_t * label;
|
||||
|
||||
btn = lv_button_create(lv_scr_act());
|
||||
btn = lv_button_create(lv_screen_active());
|
||||
lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 20);
|
||||
|
||||
label = lv_label_create(btn);
|
||||
@@ -54,7 +54,7 @@ void lv_example_style_14(void)
|
||||
|
||||
new_theme_init_and_set();
|
||||
|
||||
btn = lv_button_create(lv_scr_act());
|
||||
btn = lv_button_create(lv_screen_active());
|
||||
lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -20);
|
||||
|
||||
label = lv_label_create(btn);
|
||||
|
||||
@@ -13,7 +13,7 @@ class NewTheme(lv.theme_t):
|
||||
self.style_button.set_border_width(3)
|
||||
|
||||
# This theme is based on active theme
|
||||
th_act = lv.theme_get_from_obj(lv.scr_act())
|
||||
th_act = lv.theme_get_from_obj(lv.screen_active())
|
||||
# This theme will be applied only after base theme is applied
|
||||
self.set_parent(th_act)
|
||||
|
||||
@@ -25,7 +25,7 @@ class ExampleStyle_14:
|
||||
# Extending the current theme
|
||||
#
|
||||
|
||||
button = lv.button(lv.scr_act())
|
||||
button = lv.button(lv.screen_active())
|
||||
button.align(lv.ALIGN.TOP_MID, 0, 20)
|
||||
|
||||
label = lv.label(button)
|
||||
@@ -33,7 +33,7 @@ class ExampleStyle_14:
|
||||
|
||||
self.new_theme_init_and_set()
|
||||
|
||||
button = lv.button(lv.scr_act())
|
||||
button = lv.button(lv.screen_active())
|
||||
button.align(lv.ALIGN.BOTTOM_MID, 0, -20)
|
||||
|
||||
label = lv.label(button)
|
||||
|
||||
@@ -12,7 +12,7 @@ void lv_example_style_15(void)
|
||||
lv_obj_t * label;
|
||||
|
||||
/*Normal button*/
|
||||
btn = lv_button_create(lv_scr_act());
|
||||
btn = lv_button_create(lv_screen_active());
|
||||
lv_obj_set_size(btn, 100, 40);
|
||||
lv_obj_align(btn, LV_ALIGN_CENTER, 0, -70);
|
||||
|
||||
@@ -22,7 +22,7 @@ void lv_example_style_15(void)
|
||||
|
||||
/*Set opacity
|
||||
*The button and the label is rendered to a layer first and that layer is blended*/
|
||||
btn = lv_button_create(lv_scr_act());
|
||||
btn = lv_button_create(lv_screen_active());
|
||||
lv_obj_set_size(btn, 100, 40);
|
||||
lv_obj_set_style_opa(btn, LV_OPA_50, 0);
|
||||
lv_obj_align(btn, LV_ALIGN_CENTER, 0, 0);
|
||||
@@ -33,7 +33,7 @@ void lv_example_style_15(void)
|
||||
|
||||
/*Set transformations
|
||||
*The button and the label is rendered to a layer first and that layer is transformed*/
|
||||
btn = lv_button_create(lv_scr_act());
|
||||
btn = lv_button_create(lv_screen_active());
|
||||
lv_obj_set_size(btn, 100, 40);
|
||||
lv_obj_set_style_transform_rotation(btn, 150, 0); /*15 deg*/
|
||||
lv_obj_set_style_transform_scale(btn, 256 + 64, 0); /*1.25x*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Normal button
|
||||
button = lv.button(lv.scr_act())
|
||||
button = lv.button(lv.screen_active())
|
||||
button.set_size(100, 40)
|
||||
button.align(lv.ALIGN.CENTER, 0, -70)
|
||||
|
||||
@@ -13,7 +13,7 @@ label.center()
|
||||
|
||||
# Set opacity
|
||||
# The button and the label is rendered to a layer first and that layer is blended
|
||||
button = lv.button(lv.scr_act())
|
||||
button = lv.button(lv.screen_active())
|
||||
button.set_size(100, 40)
|
||||
button.set_style_opa(lv.OPA._50, 0)
|
||||
button.align(lv.ALIGN.CENTER, 0, 0)
|
||||
@@ -24,7 +24,7 @@ label.center()
|
||||
|
||||
# Set transformations
|
||||
# The button and the label is rendered to a layer first and that layer is transformed
|
||||
button = lv.button(lv.scr_act())
|
||||
button = lv.button(lv.screen_active())
|
||||
button.set_size(100, 40)
|
||||
button.set_style_transform_rotation(150, 0) # 15 deg
|
||||
button.set_style_transform_scale(256 + 64, 0) # 1.25x
|
||||
|
||||
@@ -25,7 +25,7 @@ void lv_example_style_2(void)
|
||||
lv_style_set_bg_grad(&style, &grad);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
lv_obj_center(obj);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ style.set_bg_main_stop(128)
|
||||
style.set_bg_grad_stop(192)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
obj.center()
|
||||
|
||||
@@ -21,7 +21,7 @@ void lv_example_style_3(void)
|
||||
lv_style_set_border_side(&style, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_RIGHT);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
lv_obj_center(obj);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ style.set_border_opa(lv.OPA._50)
|
||||
style.set_border_side(lv.BORDER_SIDE.BOTTOM | lv.BORDER_SIDE.RIGHT)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
obj.center()
|
||||
|
||||
@@ -20,7 +20,7 @@ void lv_example_style_4(void)
|
||||
lv_style_set_outline_pad(&style, 8);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
lv_obj_center(obj);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ style.set_outline_color(lv.palette_main(lv.PALETTE.BLUE))
|
||||
style.set_outline_pad(8)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
obj.center()
|
||||
|
||||
@@ -19,7 +19,7 @@ void lv_example_style_5(void)
|
||||
lv_style_set_shadow_color(&style, lv_palette_main(LV_PALETTE_BLUE));
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
lv_obj_center(obj);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ style.set_shadow_ofs_x(10)
|
||||
style.set_shadow_ofs_y(20)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.obj(lv.scr_act())
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
obj.center()
|
||||
|
||||
@@ -21,7 +21,7 @@ void lv_example_style_6(void)
|
||||
lv_style_set_transform_rotation(&style, 300);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_image_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_image_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
|
||||
LV_IMAGE_DECLARE(img_cogwheel_argb);
|
||||
|
||||
@@ -29,7 +29,7 @@ style.set_image_recolor_opa(lv.OPA._50)
|
||||
style.set_transform_rotation(300)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.image(lv.scr_act())
|
||||
obj = lv.image(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
|
||||
obj.set_src(image_cogwheel_argb)
|
||||
|
||||
@@ -13,7 +13,7 @@ void lv_example_style_7(void)
|
||||
lv_style_set_arc_width(&style, 4);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_arc_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_arc_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
lv_obj_center(obj);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ style.set_arc_color(lv.palette_main(lv.PALETTE.RED))
|
||||
style.set_arc_width(4)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.arc(lv.scr_act())
|
||||
obj = lv.arc(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
obj.center()
|
||||
|
||||
@@ -22,7 +22,7 @@ void lv_example_style_8(void)
|
||||
lv_style_set_text_decor(&style, LV_TEXT_DECOR_UNDERLINE);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_label_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_label_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
lv_label_set_text(obj, "Text of\n"
|
||||
"a label");
|
||||
|
||||
@@ -18,7 +18,7 @@ style.set_text_line_space(20)
|
||||
style.set_text_decor(lv.TEXT_DECOR.UNDERLINE)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.label(lv.scr_act())
|
||||
obj = lv.label(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
obj.set_text("Text of\n"
|
||||
"a label")
|
||||
|
||||
@@ -14,7 +14,7 @@ void lv_example_style_9(void)
|
||||
lv_style_set_line_rounded(&style, true);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_line_create(lv_scr_act());
|
||||
lv_obj_t * obj = lv_line_create(lv_screen_active());
|
||||
lv_obj_add_style(obj, &style, 0);
|
||||
|
||||
static lv_point_t p[] = {{10, 30}, {30, 50}, {100, 0}};
|
||||
|
||||
@@ -10,7 +10,7 @@ style.set_line_width(6)
|
||||
style.set_line_rounded(True)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.line(lv.scr_act())
|
||||
obj = lv.line(lv.screen_active())
|
||||
obj.add_style(style, 0)
|
||||
p = [ {"x":10, "y":30},
|
||||
{"x":30, "y":50},
|
||||
|
||||
Reference in New Issue
Block a user