Skip to content

Commit 82451db

Browse files
Close bar without animation
1 parent 5fc403e commit 82451db

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

internal_filesystem/lib/mpos/ui/topmenu.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def close_drawer(to_launcher=False):
4444
drawer_open=False
4545
if not to_launcher and not mpos.apps.is_launcher(mpos.ui.foreground_app_name):
4646
print(f"close_drawer: also closing bar because to_launcher is {to_launcher} and foreground_app_name is {mpos.ui.foreground_app_name}")
47-
close_bar()
47+
close_bar(False)
4848
WidgetAnimator.hide_widget(drawer, anim_type="slide_up", duration=1000, delay=0)
4949

5050
def open_bar():
@@ -58,12 +58,15 @@ def open_bar():
5858
else:
5959
print("bar already open")
6060

61-
def close_bar():
61+
def close_bar(animate=True):
6262
global bar_open, show_bar_animation, hide_bar_animation
6363
if bar_open:
6464
bar_open=False
6565
show_bar_animation.current_value = show_bar_animation_end_value
66-
hide_bar_animation.start()
66+
if animate:
67+
hide_bar_animation.start()
68+
else:
69+
notification_bar.set_y(hide_bar_animation_end_value)
6770

6871

6972

0 commit comments

Comments
 (0)