From f49028633f80ab1c641f29f85ae39e2184894f93 Mon Sep 17 00:00:00 2001 From: Felix Kaser Date: Wed, 28 Jul 2010 14:43:05 +0200 Subject: keep the selected contact visible after search empathy will scroll automatically to the cell which is selected, when the search is hidden. --- libempathy-gtk/empathy-individual-view.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index e6ee2e132..dceae87fa 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1289,6 +1289,7 @@ individual_view_search_hide_cb (EmpathyLiveSearch *search, { EmpathyIndividualViewPriv *priv = GET_PRIV (view); GtkTreeModel *model; + GtkTreePath *cursor_path; GtkTreeIter iter; gboolean valid = FALSE; @@ -1340,6 +1341,12 @@ individual_view_search_hide_cb (EmpathyLiveSearch *search, individual_view_row_expand_or_collapse_cb, GINT_TO_POINTER (TRUE)); g_signal_handlers_unblock_by_func (view, individual_view_row_expand_or_collapse_cb, GINT_TO_POINTER (FALSE)); + + /* keep the selected contact visible */ + gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &cursor_path, NULL); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), cursor_path, NULL, + FALSE, 0, 0); + gtk_tree_path_free (cursor_path); } static void -- cgit v1.2.3