refactor: scr -> screen, act->active, del->delete, remove in obj_clear_flag/state
This commit is contained in:
@@ -17,7 +17,7 @@ void lv_example_tiny_ttf_1(void)
|
||||
lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER);
|
||||
|
||||
/*Create a label with the new style*/
|
||||
lv_obj_t * label = lv_label_create(lv_scr_act());
|
||||
lv_obj_t * label = lv_label_create(lv_screen_active());
|
||||
lv_obj_add_style(label, &style, 0);
|
||||
lv_label_set_text(label, "Hello world\nI'm a font\ncreated\nwith Tiny TTF");
|
||||
lv_obj_center(label);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from ubuntu_font import ubuntu_font
|
||||
#
|
||||
#
|
||||
# Load a font with Tiny_TTF
|
||||
#
|
||||
#Create style with the new font
|
||||
@@ -10,7 +10,7 @@ style.set_text_font(font)
|
||||
style.set_text_align(lv.TEXT_ALIGN.CENTER)
|
||||
|
||||
# Create a label with the new style
|
||||
label = lv.label(lv.scr_act())
|
||||
label = lv.label(lv.screen_active())
|
||||
label.add_style(style, 0)
|
||||
label.set_text("Hello world\nI'm a font created with Tiny TTF")
|
||||
label.center()
|
||||
|
||||
@@ -14,7 +14,7 @@ void lv_example_tiny_ttf_2(void)
|
||||
lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER);
|
||||
|
||||
/*Create a label with the new style*/
|
||||
lv_obj_t * label = lv_label_create(lv_scr_act());
|
||||
lv_obj_t * label = lv_label_create(lv_screen_active());
|
||||
lv_obj_add_style(label, &style, 0);
|
||||
lv_label_set_text(label, "Hello world\nI'm a font\ncreated\nwith Tiny TTF");
|
||||
lv_obj_center(label);
|
||||
|
||||
@@ -7,7 +7,7 @@ fs_driver.fs_register(fs_drv, 'S')
|
||||
# get the directory in which the script is running
|
||||
try:
|
||||
script_path = __file__[:__file__.rfind('/')] if __file__.find('/') >= 0 else '.'
|
||||
except NameError:
|
||||
except NameError:
|
||||
script_path = ''
|
||||
|
||||
#
|
||||
@@ -21,7 +21,7 @@ style.set_text_font(font)
|
||||
style.set_text_align(lv.TEXT_ALIGN.CENTER)
|
||||
|
||||
# Create a label with the new style
|
||||
label = lv.label(lv.scr_act())
|
||||
label = lv.label(lv.screen_active())
|
||||
label.add_style(style, 0)
|
||||
label.set_text("Hello world\nI'm a font created with Tiny TTF")
|
||||
label.center()
|
||||
|
||||
@@ -22,19 +22,19 @@ void lv_example_tiny_ttf_3(void)
|
||||
lv_style_set_text_font(&style, font);
|
||||
lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER);
|
||||
|
||||
lv_obj_t * slider = lv_slider_create(lv_scr_act());
|
||||
lv_obj_t * slider = lv_slider_create(lv_screen_active());
|
||||
lv_obj_center(slider);
|
||||
lv_slider_set_range(slider, 5, 50);
|
||||
lv_obj_align(slider, LV_ALIGN_BOTTOM_MID, 0, -50);
|
||||
lv_slider_bind_value(slider, &subject_font);
|
||||
|
||||
lv_obj_t * slider_label = lv_label_create(lv_scr_act());
|
||||
lv_obj_t * slider_label = lv_label_create(lv_screen_active());
|
||||
lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
|
||||
lv_label_bind_text(slider_label, &subject_font, "%d");
|
||||
|
||||
|
||||
/*Create a label with the new style*/
|
||||
lv_obj_t * label = lv_label_create(lv_scr_act());
|
||||
lv_obj_t * label = lv_label_create(lv_screen_active());
|
||||
lv_obj_add_style(label, &style, 0);
|
||||
lv_obj_set_size(label, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(label, "Hello world!");
|
||||
|
||||
Reference in New Issue
Block a user