Skip to content

Commit b2e867b

Browse files
committed
fix drag icon
1 parent 30d0ab3 commit b2e867b

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
@@ -1479,12 +1479,15 @@ def motion_notify_event(self, _item, _target, event):
14791479
y = ((height_canvas + self._last_y) * scale_coef -
14801480
self.vadjustment.get_value())
14811481

1482-
drag_widget.drag_begin_with_coordinates(
1482+
context = drag_widget.drag_begin_with_coordinates(
14831483
drag_widget.drag_source_get_target_list(),
14841484
Gdk.DragAction.COPY,
14851485
Gdk.ModifierType.BUTTON1_MASK,
14861486
event,
14871487
x, y)
1488+
# set icon for person drag
1489+
Gtk.drag_set_icon_name(context, 'gramps-person', 0, 0)
1490+
14881491
return True
14891492
return False
14901493

@@ -1570,12 +1573,15 @@ def select_node(self, item, target, event):
15701573
return True
15711574

15721575
def cb_drag_begin(self, widget, data):
1573-
"""Set up some inital conditions for drag. Set up icon."""
1576+
"""
1577+
Called on start drag.
1578+
"""
15741579
self._in_drag = True
1575-
widget.drag_source_set_icon_name('gramps-person')
15761580

15771581
def cb_drag_end(self, widget, data):
1578-
"""Set up some inital conditions for drag. Set up icon."""
1582+
"""
1583+
Called when drag is end.
1584+
"""
15791585
self._in_drag = False
15801586

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

0 commit comments

Comments
 (0)