MCPcopy
hub / github.com/pdfarranger/pdfarranger / iv_button_release_event

Method iv_button_release_event

pdfarranger/pdfarranger.py:2423–2450  ·  view source on GitHub ↗

Manages mouse releases on the iconview

(self, iconview, event)

Source from the content-addressed store, hash-verified

2421 self.iv_selection_changed()
2422
2423 def iv_button_release_event(self, iconview, event):
2424 """Manages mouse releases on the iconview"""
2425 if self.end_rubberbanding:
2426 self.end_rubberbanding = False
2427 return
2428 self.iv_drag_select.end()
2429 self.iv_pan_view.end()
2430
2431 if self.pressed_button:
2432 # Button was pressed and released on a previously selected item
2433 # without causing a drag and drop.
2434 path = iconview.get_path_at_pos(event.x, event.y)
2435 if not path:
2436 return
2437 if event.state & Gdk.ModifierType.CONTROL_MASK:
2438 # Deselect the clicked item.
2439 iconview.unselect_path(path)
2440 else:
2441 # Deselect everything except the clicked item.
2442 iconview.unselect_all()
2443 iconview.select_path(path)
2444 self.iv_selection_changed()
2445 self.pressed_button = None
2446
2447 # Stop drag-select autoscrolling when button is released
2448 if self.iv_auto_scroll_timer:
2449 GObject.source_remove(self.iv_auto_scroll_timer)
2450 self.iv_auto_scroll_timer = None
2451
2452 def iv_button_press_event(self, iconview, event):
2453 """Manages mouse clicks on the iconview"""

Callers

nothing calls this directly

Calls 2

iv_selection_changedMethod · 0.95
endMethod · 0.45

Tested by

no test coverage detected