Skip to content

Commit 3b3e523

Browse files
committed
fix drag icon
1 parent d1aa42b commit 3b3e523

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
@@ -1692,12 +1692,15 @@ def motion_notify_event(self, _item, _target, event):
16921692
y = ((height_canvas + self._last_y) * scale_coef -
16931693
self.vadjustment.get_value())
16941694

1695-
drag_widget.drag_begin_with_coordinates(
1695+
context = drag_widget.drag_begin_with_coordinates(
16961696
drag_widget.drag_source_get_target_list(),
16971697
Gdk.DragAction.COPY,
16981698
Gdk.ModifierType.BUTTON1_MASK,
16991699
event,
17001700
x, y)
1701+
# set icon for person drag
1702+
Gtk.drag_set_icon_name(context, 'gramps-person', 0, 0)
1703+
17011704
return True
17021705
return False
17031706

@@ -1780,12 +1783,15 @@ def select_node(self, item, target, event):
17801783
return True
17811784

17821785
def cb_drag_begin(self, widget, data):
1783-
"""Set up some inital conditions for drag. Set up icon."""
1786+
"""
1787+
Called on start drag.
1788+
"""
17841789
self._in_drag = True
1785-
widget.drag_source_set_icon_name('gramps-person')
17861790

17871791
def cb_drag_end(self, widget, data):
1788-
"""Set up some inital conditions for drag. Set up icon."""
1792+
"""
1793+
Called when drag is end.
1794+
"""
17891795
self._in_drag = False
17901796

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

0 commit comments

Comments
 (0)