You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
ui: restore bar animations
This commit is contained in:
@@ -132,7 +132,7 @@ def try_capture(event, data):
|
||||
global current_cam_buffer, image_dsc, image, use_webcam, keepgoing
|
||||
if not keepgoing:
|
||||
print("try_capture called while keepgoing==False, aborting...")
|
||||
return
|
||||
return False # tell the task handler not to update (redraw)
|
||||
if use_webcam:
|
||||
current_cam_buffer = webcam.capture_frame(cam, "rgb565")
|
||||
elif cam.frame_available():
|
||||
@@ -253,7 +253,7 @@ else:
|
||||
except Exception as e:
|
||||
print(f"camtest.py: webcam exception: {e}")
|
||||
|
||||
if cam:
|
||||
if cam and keepgoing:
|
||||
status_label_text = ""
|
||||
qr_button.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
snap_button.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
|
||||
@@ -56,10 +56,9 @@ def open_bar():
|
||||
if not bar_open:
|
||||
print("not open so opening...")
|
||||
bar_open=True
|
||||
hide_bar_animation.current_value = hide_bar_animation_end_value # stop the hide animation
|
||||
show_bar_animation.current_value = hide_bar_animation_start_value
|
||||
#show_bar_animation.start() # coming from the camera, this doesn't work?!
|
||||
notification_bar.set_y(show_bar_animation_end_value) # workaround is fine
|
||||
hide_bar_animation.current_value = hide_bar_animation_end_value
|
||||
#show_bar_animation.current_value = hide_bar_animation_start_value
|
||||
show_bar_animation.start()
|
||||
else:
|
||||
print("bar already open")
|
||||
|
||||
@@ -67,8 +66,8 @@ def close_bar():
|
||||
global bar_open, show_bar_animation, hide_bar_animation
|
||||
if bar_open:
|
||||
bar_open=False
|
||||
show_bar_animation.current_value = show_bar_animation_end_value # stop the show animation
|
||||
hide_bar_animation.current_value = hide_bar_animation_start_value
|
||||
show_bar_animation.current_value = show_bar_animation_end_value
|
||||
#hide_bar_animation.current_value = hide_bar_animation_start_value
|
||||
hide_bar_animation.start()
|
||||
|
||||
def show_launcher():
|
||||
|
||||
Reference in New Issue
Block a user