Skip to content

Commit d67fd0d

Browse files
committed
Fix selection in rules list when open context menu
1 parent 8174c79 commit d67fd0d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/ui/widget/settings/tabs/rules/rules_list.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,16 @@ def _setup_context_menu(self):
8282
accelerator="Del"
8383
)
8484

85-
self.bind("<Button-3>", lambda event: menu.post(event.x_root, event.y_root), '+')
85+
self.bind("<Button-3>", self._show_context_menu, '+')
86+
87+
def _show_context_menu(self, event):
88+
context_menu = self._context_menu
89+
process_list = self
90+
row_id = process_list.identify_row(event.y)
91+
92+
if row_id:
93+
process_list.selection_set(row_id)
94+
context_menu.post(event.x_root, event.y_root)
8695

8796
def _errors(self) -> dict[Any, Any]:
8897
errors = [

0 commit comments

Comments
 (0)