1772: Select row on right click in embedded lists
This commit is contained in:
parent
f6ac8eb854
commit
2353c0bd34
@ -115,10 +115,20 @@ class EmbeddedList(ButtonTab):
|
|||||||
self.rebuild()
|
self.rebuild()
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
|
def _select_row_at_coords(self, x, y):
|
||||||
|
"""
|
||||||
|
Select the row at the current cursor position.
|
||||||
|
"""
|
||||||
|
wx, wy = self.tree.convert_bin_window_to_widget_coords(x, y)
|
||||||
|
row = self.tree.get_dest_row_at_pos(wx, wy)
|
||||||
|
if row:
|
||||||
|
self.tree.get_selection().select_path(row[0])
|
||||||
|
|
||||||
def _on_button_press(self, obj, event):
|
def _on_button_press(self, obj, event):
|
||||||
"""
|
"""
|
||||||
Handle button press, not double-click, that is done in init_interface
|
Handle button press, not double-click, that is done in init_interface
|
||||||
"""
|
"""
|
||||||
|
self._select_row_at_coords(event.x, event.y)
|
||||||
if is_right_click(event):
|
if is_right_click(event):
|
||||||
#ref = self.get_selected()
|
#ref = self.get_selected()
|
||||||
#if ref:
|
#if ref:
|
||||||
|
@ -109,6 +109,7 @@ class GroupEmbeddedList(EmbeddedList):
|
|||||||
"""
|
"""
|
||||||
Handle button press, not double-click, that is done in init_interface
|
Handle button press, not double-click, that is done in init_interface
|
||||||
"""
|
"""
|
||||||
|
self._select_row_at_coords(event.x, event.y)
|
||||||
if is_right_click(event):
|
if is_right_click(event):
|
||||||
obj = self.get_selected()
|
obj = self.get_selected()
|
||||||
if obj and obj[1]:
|
if obj and obj[1]:
|
||||||
|
Loading…
Reference in New Issue
Block a user