diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-28 20:13:52 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-28 20:31:45 +0800 |
commit | c4cdf9011e7cfe81b32db1742209edc7f2f54ee6 (patch) | |
tree | cb4187de71ef0f0b3a516c0c60f1611fbf7d2267 /src | |
parent | 79a01b5492f280cc8c9ceebeef046e085e684f48 (diff) | |
download | gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.tar gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.tar.gz gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.tar.bz2 gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.tar.lz gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.tar.xz gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.tar.zst gsoc2013-empathy-c4cdf9011e7cfe81b32db1742209edc7f2f54ee6.zip |
accounts_dialog_set_selected_account: scroll to the selected account
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-accounts-dialog.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 3dc600a89..501b93648 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -1943,7 +1943,20 @@ accounts_dialog_set_selected_account (EmpathyAccountsDialog *dialog, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); if (accounts_dialog_get_account_iter (dialog, account, &iter)) - gtk_tree_selection_select_iter (selection, &iter); + { + GtkTreePath *path; + GtkTreeModel *model; + + gtk_tree_selection_select_iter (selection, &iter); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); + path = gtk_tree_model_get_path (model, &iter); + + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->treeview), path, NULL, + TRUE, 0, 0.5); + + gtk_tree_path_free (path); + } } static void |