[sugar] [PATCH] Remove the Frame animation and animator.

Michael Stone michael
Wed Mar 26 00:34:32 EDT 2008


With a compositing window manager, I think it both faster and more beautiful to
show or hide the frame in one fell swoop.
---
 shell/view/frame/frame.py |   24 ++----------------------
 1 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/shell/view/frame/frame.py b/shell/view/frame/frame.py
index e8f8fa4..481fbb8 100644
--- a/shell/view/frame/frame.py
+++ b/shell/view/frame/frame.py
@@ -20,7 +20,6 @@ import gtk
 import gobject
 import hippo
 
-from sugar.graphics import animator
 from sugar.graphics import style
 from sugar.graphics import palettegroup
 from sugar.clipboard import clipboardservice
@@ -35,15 +34,6 @@ from model.shellmodel import ShellModel
 
 _FRAME_HIDING_DELAY = 500
 
-class _Animation(animator.Animation):
-    def __init__(self, frame, end):
-        start = frame.current_position
-        animator.Animation.__init__(self, start, end)
-        self._frame = frame
-
-    def next_frame(self, current):
-        self._frame.move(current)
-
 class _MouseListener(object):
     def __init__(self, frame):
         self._frame = frame
@@ -100,7 +90,6 @@ class Frame(object):
 
         self._shell = shell
         self.current_position = 0.0
-        self._animator = None
 
         self._event_area = EventArea()
         self._event_area.connect('enter', self._enter_corner_cb)
@@ -126,12 +115,7 @@ class Frame(object):
         return self.current_position != 0.0
 
     def hide(self):
-        if self._animator:
-            self._animator.stop()
-
-        self._animator = animator.Animator(0.5)
-        self._animator.add(_Animation(self, 0.0))
-        self._animator.start()
+        self.move(0.0)
 
         self._event_area.show()
 
@@ -140,16 +124,12 @@ class Frame(object):
     def show(self, mode):
         if self.visible:
             return
-        if self._animator:
-            self._animator.stop()
 
         self._shell.take_activity_screenshot()
 
         self.mode = mode
 
-        self._animator = animator.Animator(0.5)
-        self._animator.add(_Animation(self, 1.0))
-        self._animator.start()
+        self.move(1.0)
 
         self._event_area.hide()
 
-- 
1.5.3.3




More information about the Sugar-devel mailing list