diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-08-22 22:10:53 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-08-22 22:14:44 +0800 |
commit | 7afed370747294d90900447213ca996aa1a0a619 (patch) | |
tree | f786f611ce25a18742c7a051c217b28d5f0b4080 | |
parent | 3e70f6b6d2620053df4289feffed0eb9ae09812b (diff) | |
download | gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.tar gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.tar.gz gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.tar.bz2 gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.tar.lz gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.tar.xz gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.tar.zst gsoc2013-evolution-7afed370747294d90900447213ca996aa1a0a619.zip |
EShellSearchbar: Put focus on search results after changing filter.
Direct the focus away from the filter combo box so the next keyboard
event doesn't change the selected filter. The user is probably trying
to navigate search results.
-rw-r--r-- | shell/e-shell-searchbar.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index cf39d4e4e5..cb04b56e92 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -334,6 +334,24 @@ shell_searchbar_execute_search_cb (EShellView *shell_view, } static void +shell_searchbar_filter_changed_cb (GtkComboBox *filter_combo_box, + EShellSearchbar *searchbar) +{ + EShellView *shell_view; + EShellContent *shell_content; + + shell_view = e_shell_searchbar_get_shell_view (searchbar); + + e_shell_view_execute_search (shell_view); + + /* Direct the focus away from the filter combo box so the + * next keyboard event doesn't change the selected filter. + * The user is probably trying to navigate search results. */ + shell_content = e_shell_view_get_shell_content (shell_view); + e_shell_content_focus_search_results (shell_content); +} + +static void shell_searchbar_entry_activate_cb (EShellSearchbar *searchbar) { EShellView *shell_view; @@ -814,11 +832,9 @@ shell_searchbar_constructed (GObject *object) /* Use G_CONNECT_AFTER here so the EActionComboBox has a * chance to update its radio actions before we go sifting * through the radio group for the current action. */ - g_signal_connect_data ( + g_signal_connect_after ( widget, "changed", - G_CALLBACK (e_shell_view_execute_search), - shell_view, (GClosureNotify) NULL, - G_CONNECT_AFTER | G_CONNECT_SWAPPED); + G_CALLBACK (shell_searchbar_filter_changed_cb), searchbar); searchbar->priv->css_provider = gtk_css_provider_new (); widget = searchbar->priv->search_entry; |