mirror of
https://github.com/lvgl/lvgl.git
synced 2026-09-27 18:34:13 +08:00
refactor: disp->display, res->result/resolution, hor/ver->horizontal/vertical, txt->text, angle->rotation, zoom->scale
This commit is contained in:
@@ -24,7 +24,7 @@ static void new_theme_init_and_set(void)
|
||||
lv_style_set_border_width(&style_btn, 3);
|
||||
|
||||
/*Initialize the new theme from the current theme*/
|
||||
lv_theme_t * th_act = lv_disp_get_theme(NULL);
|
||||
lv_theme_t * th_act = lv_display_get_theme(NULL);
|
||||
static lv_theme_t th_new;
|
||||
th_new = *th_act;
|
||||
|
||||
@@ -33,7 +33,7 @@ static void new_theme_init_and_set(void)
|
||||
lv_theme_set_apply_cb(&th_new, new_theme_apply_cb);
|
||||
|
||||
/*Assign the new theme to the current display*/
|
||||
lv_disp_set_theme(NULL, &th_new);
|
||||
lv_display_set_theme(NULL, &th_new);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class ExampleStyle_14:
|
||||
# Initialize the new theme from the current theme
|
||||
self.th_new = NewTheme()
|
||||
self.th_new.set_apply_cb(self.new_theme_apply_cb)
|
||||
lv.disp_get_default().set_theme(self.th_new)
|
||||
lv.display_get_default().set_theme(self.th_new)
|
||||
|
||||
|
||||
exampleStyle_14 = ExampleStyle_14()
|
||||
|
||||
@@ -35,8 +35,8 @@ void lv_example_style_15(void)
|
||||
*The button and the label is rendered to a layer first and that layer is transformed*/
|
||||
btn = lv_button_create(lv_scr_act());
|
||||
lv_obj_set_size(btn, 100, 40);
|
||||
lv_obj_set_style_transform_angle(btn, 150, 0); /*15 deg*/
|
||||
lv_obj_set_style_transform_zoom(btn, 256 + 64, 0); /*1.25x*/
|
||||
lv_obj_set_style_transform_rotation(btn, 150, 0); /*15 deg*/
|
||||
lv_obj_set_style_transform_scale(btn, 256 + 64, 0); /*1.25x*/
|
||||
lv_obj_set_style_transform_pivot_x(btn, 50, 0);
|
||||
lv_obj_set_style_transform_pivot_y(btn, 20, 0);
|
||||
lv_obj_set_style_opa(btn, LV_OPA_50, 0);
|
||||
|
||||
@@ -26,8 +26,8 @@ label.center()
|
||||
# The button and the label is rendered to a layer first and that layer is transformed
|
||||
button = lv.button(lv.scr_act())
|
||||
button.set_size(100, 40)
|
||||
button.set_style_transform_angle(150, 0) # 15 deg
|
||||
button.set_style_transform_zoom(256 + 64, 0) # 1.25x
|
||||
button.set_style_transform_rotation(150, 0) # 15 deg
|
||||
button.set_style_transform_scale(256 + 64, 0) # 1.25x
|
||||
button.set_style_transform_pivot_x(50, 0)
|
||||
button.set_style_transform_pivot_y(20, 0)
|
||||
button.set_style_opa(lv.OPA._50, 0)
|
||||
|
||||
@@ -18,7 +18,7 @@ void lv_example_style_6(void)
|
||||
|
||||
lv_style_set_image_recolor(&style, lv_palette_main(LV_PALETTE_BLUE));
|
||||
lv_style_set_image_recolor_opa(&style, LV_OPA_50);
|
||||
lv_style_set_transform_angle(&style, 300);
|
||||
lv_style_set_transform_rotation(&style, 300);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
lv_obj_t * obj = lv_image_create(lv_scr_act());
|
||||
|
||||
@@ -26,7 +26,7 @@ style.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
|
||||
|
||||
style.set_image_recolor(lv.palette_main(lv.PALETTE.BLUE))
|
||||
style.set_image_recolor_opa(lv.OPA._50)
|
||||
style.set_transform_angle(300)
|
||||
style.set_transform_rotation(300)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.image(lv.scr_act())
|
||||
|
||||
Reference in New Issue
Block a user