diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py index 8723c61ed..10228e4d4 100644 --- a/gramps/gui/editors/displaytabs/embeddedlist.py +++ b/gramps/gui/editors/displaytabs/embeddedlist.py @@ -100,10 +100,20 @@ class EmbeddedList(ButtonTab): self.rebuild() 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): """ 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): #ref = self.get_selected() #if ref: diff --git a/gramps/gui/editors/displaytabs/groupembeddedlist.py b/gramps/gui/editors/displaytabs/groupembeddedlist.py index 2a328638b..fa507517b 100644 --- a/gramps/gui/editors/displaytabs/groupembeddedlist.py +++ b/gramps/gui/editors/displaytabs/groupembeddedlist.py @@ -108,6 +108,7 @@ class GroupEmbeddedList(EmbeddedList): """ 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): obj = self.get_selected() if obj and obj[1]: