diff options
-rw-r--r-- | embed/ephy-web-view.c | 25 | ||||
-rw-r--r-- | src/ephy-find-toolbar.c | 13 |
2 files changed, 26 insertions, 12 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 1e1ce1864..a1228904a 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -486,6 +486,22 @@ ephy_web_view_file_monitor_cancel (EphyWebView *view) priv->reload_delay_ticks = 0; } +static gboolean +ephy_web_view_key_press_event (GtkWidget *widget, GdkEventKey *event) +{ + EphyWebView *web_view = EPHY_WEB_VIEW (widget); + gboolean key_handled = FALSE; + + key_handled = GTK_WIDGET_CLASS (ephy_web_view_parent_class)->key_press_event (widget, event); + + if (key_handled) + return TRUE; + + g_signal_emit_by_name (web_view, "search-key-press", event, &key_handled); + + return key_handled; +} + static void ephy_web_view_dispose (GObject *object) { @@ -526,12 +542,15 @@ static void ephy_web_view_class_init (EphyWebViewClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); gobject_class->dispose = ephy_web_view_dispose; gobject_class->finalize = ephy_web_view_finalize; gobject_class->get_property = ephy_web_view_get_property; gobject_class->set_property = ephy_web_view_set_property; + widget_class->key_press_event = ephy_web_view_key_press_event; + g_object_class_install_property (gobject_class, PROP_ADDRESS, g_param_spec_string ("address", @@ -851,14 +870,14 @@ ephy_web_view_class_init (EphyWebViewClass *klass) G_TYPE_POINTER); /** - * EphyWebView::ge-search-key-press: + * EphyWebView::search-key-press: * @embed: * @event: the #GdkEventKey which triggered this signal * - * The ::ge-search-key-press signal is emitted for keypresses which + * The ::search-key-press signal is emitted for keypresses which * should be used for find implementations. **/ - g_signal_new ("ge-search-key-press", + g_signal_new ("search-key-press", EPHY_TYPE_WEB_VIEW, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EphyWebViewClass, search_key_press), diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c index 8cf490e78..bc8a46563 100644 --- a/src/ephy-find-toolbar.c +++ b/src/ephy-find-toolbar.c @@ -178,7 +178,6 @@ clear_status (EphyFindToolbar *toolbar) priv->links_only ? _("Find links:") : _("Find:")); } -#if 0 /* Code adapted from gtktreeview.c:gtk_tree_view_key_press() and * gtk_tree_view_real_start_interactive_seach() */ @@ -212,7 +211,6 @@ tab_search_key_press_cb (EphyEmbed *embed, return FALSE; } -#endif static void find_next_cb (EphyFindToolbar *toolbar) @@ -737,10 +735,9 @@ ephy_find_toolbar_set_embed (EphyFindToolbar *toolbar, if (priv->web_view != NULL) { - /* - g_signal_handlers_disconnect_matched (embed, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, toolbar); - */ + g_signal_handlers_disconnect_matched (EPHY_WEB_VIEW (web_view), + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, toolbar); } priv->web_view = web_view; @@ -748,11 +745,9 @@ ephy_find_toolbar_set_embed (EphyFindToolbar *toolbar, { clear_status (toolbar); - /* FIXME: this is never emitted - g_signal_connect_object (embed, "ge-search-key-press", + g_signal_connect_object (EPHY_WEB_VIEW (web_view), "search-key-press", G_CALLBACK (tab_search_key_press_cb), toolbar, 0); - */ } } |