@@ -95,7 +95,7 @@ def hide_widget(widget, anim_type="fade", duration=500, delay=0):
9595 anim .set_custom_exec_cb (lambda anim , value : widget .set_y (value ))
9696 anim .set_path_cb (lv .anim_t .path_ease_in_out )
9797 # Set HIDDEN flag after animation
98- anim .set_completed_cb (lambda * args : WidgetAnimator .hide_complete_cb (widget ))
98+ anim .set_completed_cb (lambda * args : WidgetAnimator .hide_complete_cb (widget , original_y ))
9999 elif anim_type == "slide_up" :
100100 print ("hide with slide_up" )
101101 # Create slide-up animation (y from original y to -height)
@@ -110,18 +110,18 @@ def hide_widget(widget, anim_type="fade", duration=500, delay=0):
110110 anim .set_custom_exec_cb (lambda anim , value : widget .set_y (value ))
111111 anim .set_path_cb (lv .anim_t .path_ease_in_out )
112112 # Set HIDDEN flag after animation
113- anim .set_completed_cb (lambda * args : WidgetAnimator .hide_complete_cb (widget ))
113+ anim .set_completed_cb (lambda * args : WidgetAnimator .hide_complete_cb (widget , original_y ))
114114
115115 # Store and start animation
116116 #self.animations[widget] = anim
117117 anim .start ()
118118
119119 @staticmethod
120- def hide_complete_cb (widget ):
120+ def hide_complete_cb (widget , original_y = None ):
121121 #print("hide_complete_cb")
122122 widget .add_flag (lv .obj .FLAG .HIDDEN )
123- # if original_y:
124- # widget.set_y(original_y) # in case it shifted slightly due to rounding etc
123+ if original_y :
124+ widget .set_y (original_y ) # in case it shifted slightly due to rounding etc
125125
126126
127127def smooth_show (widget ):
0 commit comments