Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-12-06 02:48:54 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-06 02:48:54 (GMT)
commit12dc8871141919998146ec44ddc2f191ed99f632 (patch)
tree780acfa3a06454d5f66b4273d3b2274390e28be6
parentf0aedd0e620a2dc749c8ae96db313ba8606ab834 (diff)
Actions : Correcting drag and drop behaviour on elements that don't support it
-rw-r--r--tutorius/actions.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tutorius/actions.py b/tutorius/actions.py
index a809980..cf586f2 100644
--- a/tutorius/actions.py
+++ b/tutorius/actions.py
@@ -87,6 +87,14 @@ class DragWrapper(object):
pxbuf.get_from_drawable(px,gtk.gdk.colormap_get_system(), 0, 0, 0, 0, -1, -1)
drag_context.set_icon_pixbuf(pxbuf,0,0)
+
+ def _drag_fail(self, *args):
+ """
+ Callback to prevent the animation that brings back the dragged item to
+ its initial position.
+ """
+ LOGGER.debug("DragWrapper :: Drag fail event was raised")
+ return True
def _drag_end(self, widget, context, *args):
"""Callback for end of drag (stolen focus)."""
@@ -102,7 +110,6 @@ class DragWrapper(object):
self.update_action_cb('position', self.position)
-
def set_draggable(self, value):
"""Setter for the draggable property"""
if bool(value) ^ bool(self._drag_on):
@@ -121,6 +128,8 @@ class DragWrapper(object):
self._handles.append(self._eventbox.connect(
"drag-begin", self._drag_begin))
self._handles.append(self._eventbox.connect(
+ "drag-failed", self._drag_fail))
+ self._handles.append(self._eventbox.connect(
"drag-end", self._drag_end))
else:
while len(self._handles):