From 2c04bf08b4c978054d020ec398f9a4d7ce74d0fc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Jun 2006 23:18:51 -0400 Subject: [PATCH] Use non-linear algorithm for sliding window animations --- sugar/shell/WindowManager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sugar/shell/WindowManager.py b/sugar/shell/WindowManager.py index 7e9a2fe6..a3d8d5db 100644 --- a/sugar/shell/WindowManager.py +++ b/sugar/shell/WindowManager.py @@ -84,9 +84,10 @@ class WindowManager: def __slide_in_timeout_cb(self): self._window.show() - self._sliding_pos += 0.05 + left = 1.0 - self._sliding_pos + self._sliding_pos += (left / 2) - if self._sliding_pos > 1.0: + if self._sliding_pos > .999: self._sliding_pos = 1.0 self._update_size_and_position() @@ -99,9 +100,10 @@ class WindowManager: def __slide_out_timeout_cb(self): self._window.show() - self._sliding_pos -= 0.05 + left = self._sliding_pos + self._sliding_pos -= (left / 2) - if self._sliding_pos < 0: + if self._sliding_pos < .001: self._sliding_pos = 0 self._update_size_and_position()