Set focus on search entry after search

Closes #13328
This commit is contained in:
Cédric Krier
2024-06-11 09:29:57 +02:00
parent 84f987b673
commit bff6733ca7
6 changed files with 8 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Set focus on search entry after search
* Support language suffix in CSV export
* Close tab with mouse middle click
* Support language suffix in CSV import
+1
View File
@@ -1097,6 +1097,7 @@
return ids;
}
this.clear();
this.screen_container.search_entry.focus();
return this.load(ids).then(() => {
this.count_tab_domain();
});
+3
View File
@@ -984,6 +984,9 @@
}
});
});
this.el.on('shown.bs.modal', () => {
this.screen.screen_container.search_entry.focus();
});
this.el.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
+1
View File
@@ -1,3 +1,4 @@
* Set focus on search entry after search
* Support language suffix in CSV export
* Close tab with mouse middle click
* Support language suffix in CSV import
@@ -323,6 +323,7 @@ class Screen:
if only_ids:
return ids
self.clear()
GLib.idle_add(self.screen_container.search_entry.grab_focus)
self.load(ids)
self.count_tab_domain()
return bool(ids)
@@ -1220,9 +1220,9 @@ class ViewTree(View):
label.set_text(text)
def set_cursor(self, new=False, reset_view=True):
self.treeview.grab_focus()
model = self.treeview.get_model()
if self.record and model and self.treeview.get_realized():
self.treeview.grab_focus()
path = self.record.get_index_path(model.group)
if model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY:
path = (path[0],)