diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2010-12-14 15:54:07 -0800 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2011-01-07 13:34:34 -0800 |
commit | 1788b7a040fcb6074ab2bbf322e2385be5661b28 (patch) | |
tree | 90ede3d28dfec6b0621044272b40f8bd5711922c /caribou/ui/animation.py | |
parent | 0b5e10eed67e5aa0734735ea19c11a611b486624 (diff) | |
download | caribou-1788b7a040fcb6074ab2bbf322e2385be5661b28.tar.gz |
Transitioned to introspection GTK3. Things that are not working yet:
- GConf notification. Not critical, will get it working when we move to
GSettings.
- Scanning. The module needs a lot of work anyway, will probably be doing alot
of cleanup with transition.
- Proximity opacity. This has been a hidden feature anyway.
- Animation. Ditto, it's been hidden. Need to expose those two settings in the
UI.
Diffstat (limited to 'caribou/ui/animation.py')
-rw-r--r-- | caribou/ui/animation.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/caribou/ui/animation.py b/caribou/ui/animation.py index 44a9dfd..c382929 100644 --- a/caribou/ui/animation.py +++ b/caribou/ui/animation.py @@ -18,16 +18,16 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -import clutter +from gi.repository import Clutter class AnimatedWindowBase(object): - def __init__(self, ease=clutter.EASE_IN_QUAD): + def __init__(self, ease=Clutter.AnimationMode.EASE_IN_QUAD): if self.__class__ == AnimatedWindowBase: raise TypeError, \ "AnimatedWindowBase is an abstract class, " \ - "must be subclassed with a gtk.Window" + "must be subclassed with a Gtk.Window" - self._actor = clutter.Rectangle() + self._actor = Clutter.Rectangle() self.ease = ease def _on_new_frame(self, timeline, timing): @@ -37,25 +37,27 @@ class AnimatedWindowBase(object): def animated_move(self, x, y): orig_x, orig_y = self.get_position() self._actor.set_position(orig_x, orig_y) - self._actor.set_size(self.allocation.width, self.allocation.height) - animation = self._actor.animate( - self.ease, 250, "x", x, "y", y) + #allocation = self.get_allocation() + #print allocation.width, allocation.height + #self._actor.set_size(self.allocation.width, self.allocation.height) + animation = self._actor.animatev(self.ease, 250, ["x", "y"]) timeline = animation.get_timeline() timeline.connect('new-frame', self._on_new_frame) return animation if __name__ == "__main__": - import gtk - class AnimatedWindow(gtk.Window, AnimatedWindowBase): + import gobject + from gi.repository import Gtk + class AnimatedWindow(Gtk.Window, AnimatedWindowBase): def __init__(self): - gtk.Window.__init__(self) + gobject.GObject.__init__(self) AnimatedWindowBase.__init__(self) aw = AnimatedWindow() aw.show_all() aw.move(100, 100) - aw.animated_move(200, 200) - gtk.main() + #aw.animated_move(200, 200) + Gtk.main() |