Skip to content

Commit

Permalink
fix drag icon
Browse files Browse the repository at this point in the history
  • Loading branch information
vantu5z committed Sep 23, 2019
1 parent f993a19 commit 69aa5fe
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions GraphView/graphview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,12 +1388,15 @@ def motion_notify_event(self, item, target, event):
y = ((height_canvas + self._last_y) * scale_coef -
self.vadjustment.get_value())

drag_widget.drag_begin_with_coordinates(
context = drag_widget.drag_begin_with_coordinates(
drag_widget.drag_source_get_target_list(),
Gdk.DragAction.COPY,
Gdk.ModifierType.BUTTON1_MASK,
event,
x, y)
# set icon for person drag
Gtk.drag_set_icon_name(context, 'gramps-person', 0, 0)

return True
return False

Expand Down Expand Up @@ -1479,12 +1482,15 @@ def select_node(self, item, target, event):
return True

def cb_drag_begin(self, widget, data):
"""Set up some inital conditions for drag. Set up icon."""
"""
Called on start drag.
"""
self._in_drag = True
widget.drag_source_set_icon_name('gramps-person')

def cb_drag_end(self, widget, data):
"""Set up some inital conditions for drag. Set up icon."""
"""
Called when drag is end.
"""
self._in_drag = False

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

0 comments on commit 69aa5fe

Please sign in to comment.