From 0319a5272859c55600a452a764415eb07a32440d Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Fri, 16 May 2025 09:19:05 +0200 Subject: [PATCH] ui: restore bar animations --- .../apps/com.example.camtest/assets/camtest.py | 4 ++-- internal_filesystem/lib/mpos/ui.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/internal_filesystem/apps/com.example.camtest/assets/camtest.py b/internal_filesystem/apps/com.example.camtest/assets/camtest.py index a5bea522..714f3bb2 100644 --- a/internal_filesystem/apps/com.example.camtest/assets/camtest.py +++ b/internal_filesystem/apps/com.example.camtest/assets/camtest.py @@ -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) diff --git a/internal_filesystem/lib/mpos/ui.py b/internal_filesystem/lib/mpos/ui.py index 94e9e8da..080533d6 100644 --- a/internal_filesystem/lib/mpos/ui.py +++ b/internal_filesystem/lib/mpos/ui.py @@ -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():