[pitivi: 6/20] ui.trackobject.py: use controller modifer state to determine context mode; set context mode after ke
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 6/20] ui.trackobject.py: use controller modifer state to determine context mode; set context mode after ke
- Date: Wed, 15 Jul 2009 06:37:23 +0000 (UTC)
commit bc835d6569912f82b67ebbc498427cead64b8a86
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Tue Jul 7 00:09:41 2009 -0700
ui.trackobject.py: use controller modifer state to determine context mode; set context mode after keyboard events
pitivi/ui/trackobject.py | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index 99db222..0a48222 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -120,13 +120,20 @@ class TimelineController(controller.Controller):
self._context.editTo(position, priority)
def _getMode(self):
- s = self._last_event.get_state()
- if s & gtk.gdk.SHIFT_MASK:
+ if self._shift_down:
return self._context.RIPPLE
- elif s & gtk.gdk.CONTROL_MASK:
+ elif self._control_down:
return self._context.ROLL
return self._context.DEFAULT
+ def key_press(self, keyval):
+ if self._dragging:
+ self._context.setMode(self._getMode())
+
+ def key_release(self, keyval):
+ if self._dragging:
+ self._context.setMode(self._getMode())
+
class TrimHandle(View, goocanvas.Image, Zoomable):
"""A component of a TrackObject which manage's the source's edit
@@ -196,8 +203,7 @@ class TrackObject(View, goocanvas.Group, Zoomable):
self._view.app.action_log.begin("move object")
def _getMode(self):
- s = self._last_event.get_state()
- if s & gtk.gdk.SHIFT_MASK:
+ if self._shift_down:
return self._context.RIPPLE
return self._context.DEFAULT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]