mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-21 16:59:50 +00:00
[GTK3] Fix column header right-click menu popup
The popup_at_pointer method is only available in GTK >=3.22 so for compatibility restore using popup method. Right-clicking on column headers popped-up torrent menu so only show this menu when in torrentview.
This commit is contained in:
parent
ce49cde49d
commit
70d5931622
@ -346,7 +346,7 @@ class ListView(object):
|
|||||||
|
|
||||||
def on_treeview_header_right_clicked(self, column, event):
|
def on_treeview_header_right_clicked(self, column, event):
|
||||||
if event.button == 3:
|
if event.button == 3:
|
||||||
self.menu.popup_at_pointer()
|
self.menu.popup(None, None, None, None, event.button, event.get_time())
|
||||||
|
|
||||||
def register_checklist_menu(self, menu):
|
def register_checklist_menu(self, menu):
|
||||||
"""Register a checklist menu with the listview. It will automatically
|
"""Register a checklist menu with the listview. It will automatically
|
||||||
|
@ -792,7 +792,7 @@ class TorrentView(ListView, component.Component):
|
|||||||
"""This is a callback for showing the right-click context menu."""
|
"""This is a callback for showing the right-click context menu."""
|
||||||
log.debug('on_button_press_event')
|
log.debug('on_button_press_event')
|
||||||
# We only care about right-clicks
|
# We only care about right-clicks
|
||||||
if event.button == 3:
|
if event.button == 3 and event.window == self.treeview.get_bin_window():
|
||||||
x, y = event.get_coords()
|
x, y = event.get_coords()
|
||||||
path = self.treeview.get_path_at_pos(int(x), int(y))
|
path = self.treeview.get_path_at_pos(int(x), int(y))
|
||||||
if not path:
|
if not path:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user