From fbc500066f4558958f4a189df0a5eedc6d60a328 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:34:25 +0900 Subject: [PATCH] fix: focus first row --- helpers/ui.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helpers/ui.py b/helpers/ui.py index 99d8102..1b55aa9 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -969,6 +969,11 @@ class TreeView(Gtk.TreeView): else: return False + def _focus_first_row(self): + path = Gtk.TreePath(0) + it = mod_store.get_iter(path) + self.get_selection().select_path(path) + def get_column_at_index(self, index): select = self.get_selection() sels = select.get_selected_rows() @@ -1058,6 +1063,7 @@ class TreeView(Gtk.TreeView): #2024-11-12 toggle_signal(self, self.selected_row, '_on_tree_selection_changed', True) toggle_signal(self, self, '_on_keypress', True) + self._focus_first_row() grid = self.get_outer_grid() right_panel = grid.right_panel