MCPcopy
hub / github.com/pdfarranger/pdfarranger / iv_motion

Method iv_motion

pdfarranger/pdfarranger.py:2399–2421  ·  view source on GitHub ↗

Manages mouse movement on the iconview.

(self, iconview, event)

Source from the content-addressed store, hash-verified

2397 return True # call me again
2398
2399 def iv_motion(self, iconview, event):
2400 """Manages mouse movement on the iconview."""
2401 # Pan the view when pressing mouse wheel and moving mouse
2402 if event.state & Gdk.ModifierType.BUTTON2_MASK:
2403 self.iv_pan_view.motion(event)
2404
2405 # Detect drag and drop events
2406 if self.pressed_button:
2407 if iconview.drag_check_threshold(self.pressed_button.x,
2408 self.pressed_button.y,
2409 event.x, event.y):
2410 iconview.drag_begin_with_coordinates(Gtk.TargetList.new(self.TARGETS_IV),
2411 Gdk.DragAction.COPY | Gdk.DragAction.MOVE,
2412 self.pressed_button.button, event, -1, -1)
2413 self.pressed_button = None
2414
2415 # Drag-select when clicking between items and dragging mouse
2416 if event.state & Gdk.ModifierType.BUTTON1_MASK and self.iv_drag_select.click_location:
2417 self.iv_autoscroll(event.x, event.y, autoscroll_area=4)
2418 if not self.click_path:
2419 changed = self.iv_drag_select.motion(event)
2420 if changed:
2421 self.iv_selection_changed()
2422
2423 def iv_button_release_event(self, iconview, event):
2424 """Manages mouse releases on the iconview"""

Callers

nothing calls this directly

Calls 3

iv_autoscrollMethod · 0.95
iv_selection_changedMethod · 0.95
motionMethod · 0.45

Tested by

no test coverage detected