refactor(btn, img): rename btn to button and img to image
This commit is contained in:
@@ -6,7 +6,7 @@ except:
|
||||
print("Could not find imgbtn_left.png")
|
||||
sys.exit()
|
||||
|
||||
imgbtn_left_dsc = lv.img_dsc_t({
|
||||
imgbtn_left_dsc = lv.image_dsc_t({
|
||||
'data_size': len(imgbtn_left_data),
|
||||
'data': imgbtn_left_data
|
||||
})
|
||||
@@ -18,7 +18,7 @@ except:
|
||||
print("Could not find imgbtn_mid.png")
|
||||
sys.exit()
|
||||
|
||||
imgbtn_mid_dsc = lv.img_dsc_t({
|
||||
imgbtn_mid_dsc = lv.image_dsc_t({
|
||||
'data_size': len(imgbtn_mid_data),
|
||||
'data': imgbtn_mid_data
|
||||
})
|
||||
@@ -27,16 +27,16 @@ try:
|
||||
with open('../../assets/imgbtn_right.png','rb') as f:
|
||||
imgbtn_right_data = f.read()
|
||||
except:
|
||||
print("Could not find imgbtn_right.png")
|
||||
print("Could not find imgtn_right.png")
|
||||
sys.exit()
|
||||
|
||||
imgbtn_right_dsc = lv.img_dsc_t({
|
||||
imgbtn_right_dsc = lv.image_dsc_t({
|
||||
'data_size': len(imgbtn_right_data),
|
||||
'data': imgbtn_right_data
|
||||
})
|
||||
|
||||
# Create a transition animation on width transformation and recolor.
|
||||
tr_prop = [lv.STYLE.TRANSFORM_WIDTH, lv.STYLE.IMG_RECOLOR_OPA, 0]
|
||||
tr_prop = [lv.STYLE.TRANSFORM_WIDTH, lv.STYLE.IMAGE_RECOLOR_OPA, 0]
|
||||
tr = lv.style_transition_dsc_t()
|
||||
tr.init(tr_prop, lv.anim_t.path_linear, 200, 0, None)
|
||||
|
||||
@@ -48,8 +48,8 @@ style_def.set_transition(tr)
|
||||
# Darken the button when pressed and make it wider
|
||||
style_pr = lv.style_t()
|
||||
style_pr.init()
|
||||
style_pr.set_img_recolor_opa(lv.OPA._30)
|
||||
style_pr.set_img_recolor(lv.color_black())
|
||||
style_pr.set_image_recolor_opa(lv.OPA._30)
|
||||
style_pr.set_image_recolor(lv.color_black())
|
||||
style_pr.set_transform_width(20)
|
||||
|
||||
# Create an image button
|
||||
|
||||
Reference in New Issue
Block a user