fixes and update on animated icon contexmanager gitea and menu_bar
This commit is contained in:
@@ -837,16 +837,16 @@ class Translate:
|
||||
@contextmanager
|
||||
def message_box_animation(animated_icon):
|
||||
"""
|
||||
A context manager to handle starting and stopping an animated icon
|
||||
A context manager to handle pausing and resuming an animated icon
|
||||
around an operation like showing a message box.
|
||||
|
||||
Args:
|
||||
animated_icon: The animated icon object with start() and stop() methods.
|
||||
animated_icon: The animated icon object with pause() and resume() methods.
|
||||
"""
|
||||
if animated_icon:
|
||||
animated_icon.stop()
|
||||
animated_icon.pause()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if animated_icon:
|
||||
animated_icon.start()
|
||||
animated_icon.resume()
|
||||
|
||||
Reference in New Issue
Block a user