refactor(btn, img): rename btn to button and img to image

This commit is contained in:
Gabor Kiss-Vamosi
2023-09-14 20:12:31 +02:00
parent e91786ce49
commit 09c12d0f9c
366 changed files with 3271 additions and 3222 deletions

View File

@@ -5,22 +5,22 @@ import display_driver
# Create an image from the png file
try:
with open('../../assets/img_cogwheel_argb.png','rb') as f:
with open('../../assets/image_cogwheel_argb.png','rb') as f:
png_data = f.read()
except:
print("Could not find img_cogwheel_argb.png")
print("Could not find image_cogwheel_argb.png")
sys.exit()
img_cogwheel_argb = lv.img_dsc_t({
image_cogwheel_argb = lv.image_dsc_t({
'data_size': len(png_data),
'data': png_data
})
img1 = lv.img(lv.scr_act())
img1.set_src(img_cogwheel_argb)
img1.align(lv.ALIGN.CENTER, 0, -20)
img1.set_size(200, 200)
image1 = lv.image(lv.scr_act())
image1.set_src(image_cogwheel_argb)
image1.align(lv.ALIGN.CENTER, 0, -20)
image1.set_size(200, 200)
img2 = lv.img(lv.scr_act())
img2.set_src(lv.SYMBOL.OK + "Accept")
img2.align_to(img1, lv.ALIGN.OUT_BOTTOM_MID, 0, 20)
image2 = lv.image(lv.scr_act())
image2.set_src(lv.SYMBOL.OK + "Accept")
image2.align_to(image1, lv.ALIGN.OUT_BOTTOM_MID, 0, 20)