aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-view.c
diff options
context:
space:
mode:
authorFelix Kaser <f.kaser@gmx.net>2010-07-28 20:43:05 +0800
committerFelix Kaser <f.kaser@gmx.net>2010-07-29 21:48:13 +0800
commitf49028633f80ab1c641f29f85ae39e2184894f93 (patch)
treefdd7a0aa2e4e3c708cd5aa92ee2623758cc1686e /libempathy-gtk/empathy-individual-view.c
parent6568f7b78787cd1c6dbf7a447b71865986b12bc6 (diff)
downloadgsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.tar
gsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.tar.gz
gsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.tar.bz2
gsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.tar.lz
gsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.tar.xz
gsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.tar.zst
gsoc2013-empathy-f49028633f80ab1c641f29f85ae39e2184894f93.zip
keep the selected contact visible after search
empathy will scroll automatically to the cell which is selected, when the search is hidden.
Diffstat (limited to 'libempathy-gtk/empathy-individual-view.c')
-rw-r--r--libempathy-gtk/empathy-individual-view.c7
1 files changed, 7 insertions, 0 deletions
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