[pitivi: 2/20] ui.trackobject.py: activate roll mode when shift is held down during drag
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 2/20] ui.trackobject.py: activate roll mode when shift is held down during drag
- Date: Wed, 15 Jul 2009 06:37:03 +0000 (UTC)
commit 8b6c6fbf9087c74ad612ba02fb46003fcfd3bbb7
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Mon Jul 6 23:34:06 2009 -0700
ui.trackobject.py: activate roll mode when shift is held down during drag
pitivi/ui/trackobject.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index e75b021..99db222 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -116,8 +116,17 @@ class TimelineController(controller.Controller):
x, y = pos
position = Zoomable.pixelToNs(x)
priority = int((y - self._y_offset) // (LAYER_HEIGHT_EXPANDED + LAYER_SPACING))
+ self._context.setMode(self._getMode())
self._context.editTo(position, priority)
+ def _getMode(self):
+ s = self._last_event.get_state()
+ if s & gtk.gdk.SHIFT_MASK:
+ return self._context.RIPPLE
+ elif s & gtk.gdk.CONTROL_MASK:
+ return self._context.ROLL
+ return self._context.DEFAULT
+
class TrimHandle(View, goocanvas.Image, Zoomable):
"""A component of a TrackObject which manage's the source's edit
@@ -186,6 +195,12 @@ class TrackObject(View, goocanvas.Group, Zoomable):
self._view.timeline.selection.getSelectedTrackObjs())
self._view.app.action_log.begin("move object")
+ def _getMode(self):
+ s = self._last_event.get_state()
+ if s & gtk.gdk.SHIFT_MASK:
+ return self._context.RIPPLE
+ return self._context.DEFAULT
+
def click(self, pos):
mode = SELECT
if self._last_event.get_state() & gtk.gdk.SHIFT_MASK:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]