Skip to content

Commit

Permalink
Show right-click menu also when clicking on empty area
Browse files Browse the repository at this point in the history
Close #502
  • Loading branch information
kbengs authored and angsch committed Jun 30, 2021
1 parent 3ccae79 commit d32883e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pdfarranger/pdfarranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,13 +1575,15 @@ def iv_button_press_event(self, iconview, event):

# Display right click menu
if event.button == 3:
selection = iconview.get_selected_items()
if self.click_path:
selection = iconview.get_selected_items()
if self.click_path not in selection:
iconview.unselect_all()
iconview.select_path(self.click_path)
iconview.grab_focus()
self.popup.popup(None, None, None, None, event.button, event.time)
iconview.select_path(self.click_path)
else:
iconview.unselect_all()
iconview.grab_focus()
self.popup.popup(None, None, None, None, event.button, event.time)
return 1

def iv_key_press_event(self, iconview, event):
Expand Down

0 comments on commit d32883e

Please sign in to comment.