Skip to content

Commit 69aa5fe

Browse files
committed
fix drag icon
1 parent f993a19 commit 69aa5fe

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

GraphView/graphview.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,12 +1388,15 @@ def motion_notify_event(self, item, target, event):
13881388
y = ((height_canvas + self._last_y) * scale_coef -
13891389
self.vadjustment.get_value())
13901390

1391-
drag_widget.drag_begin_with_coordinates(
1391+
context = drag_widget.drag_begin_with_coordinates(
13921392
drag_widget.drag_source_get_target_list(),
13931393
Gdk.DragAction.COPY,
13941394
Gdk.ModifierType.BUTTON1_MASK,
13951395
event,
13961396
x, y)
1397+
# set icon for person drag
1398+
Gtk.drag_set_icon_name(context, 'gramps-person', 0, 0)
1399+
13971400
return True
13981401
return False
13991402

@@ -1479,12 +1482,15 @@ def select_node(self, item, target, event):
14791482
return True
14801483

14811484
def cb_drag_begin(self, widget, data):
1482-
"""Set up some inital conditions for drag. Set up icon."""
1485+
"""
1486+
Called on start drag.
1487+
"""
14831488
self._in_drag = True
1484-
widget.drag_source_set_icon_name('gramps-person')
14851489

14861490
def cb_drag_end(self, widget, data):
1487-
"""Set up some inital conditions for drag. Set up icon."""
1491+
"""
1492+
Called when drag is end.
1493+
"""
14881494
self._in_drag = False
14891495

14901496
def cb_drag_data_get(self, widget, context, sel_data, info, time):

0 commit comments

Comments
 (0)