From 45def779c085277b160b016d0fa75004a82f8439 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 4 Dec 2005 21:52:05 +0000 Subject: While in find mode, set the selection colour to "attention". 2005-12-04 Christian Persch * embed/ephy-embed-find.c: (ephy_embed_find_set_selection): * embed/ephy-embed-find.h: * embed/mozilla/EphyFind.cpp: * embed/mozilla/EphyFind.h: * embed/mozilla/mozilla-embed-find.cpp: While in find mode, set the selection colour to "attention". * src/ephy-find-toolbar.c: (set_status), (clear_status), (tab_search_key_press_cb), (entry_key_press_event_cb), (entry_activate_cb), (set_focus_cb), (ephy_find_toolbar_set_window), (ephy_find_toolbar_init), (ephy_find_toolbar_class_init), (ephy_find_toolbar_set_embed), (ephy_find_toolbar_open), (ephy_find_toolbar_close), (ephy_find_toolbar_request_close): * src/ephy-find-toolbar.h: * src/ephy-window.c: (sync_tab_document_type), (find_toolbar_close_cb), (ephy_window_set_print_preview), (ephy_window_get_find_toolbar), (ephy_window_get_context_event): Refactor find toolbar closing not to crash with auto-closing popups. Unset the selection colour on close. Remove dead #ifdef FIND_WHILE_TYPING_IN_EMBED code. --- src/ephy-window.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 0ca6088df..6f64ff023 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1343,7 +1343,7 @@ sync_tab_document_type (EphyTab *tab, if (!can_find) { - ephy_find_toolbar_close (priv->find_toolbar); + ephy_find_toolbar_request_close (priv->find_toolbar); } } @@ -2951,7 +2951,17 @@ static void find_toolbar_close_cb (EphyFindToolbar *toolbar, EphyWindow *window) { - gtk_widget_hide (GTK_WIDGET (toolbar)); + EphyWindowPrivate *priv = window->priv; + EphyTab *tab; + + if (priv->closing) return; + + ephy_find_toolbar_close (priv->find_toolbar); + + tab = ephy_window_get_active_tab (window); + if (tab == NULL) return; + + gtk_widget_grab_focus (GTK_WIDGET (tab)); } static void @@ -3205,6 +3215,8 @@ ephy_window_set_print_preview (EphyWindow *window, { g_return_if_fail (priv->ppview_toolbar == NULL); + ephy_find_toolbar_request_close (priv->find_toolbar); + priv->ppview_toolbar = ppview_toolbar_new (window); gtk_window_remove_accel_group (GTK_WINDOW (window), accel_group); } @@ -3279,9 +3291,9 @@ ephy_window_get_notebook (EphyWindow *window) GtkWidget * ephy_window_get_find_toolbar (EphyWindow *window) { - g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL); + g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL); - return GTK_WIDGET (window->priv->find_toolbar); + return GTK_WIDGET (window->priv->find_toolbar); } /** @@ -3689,4 +3701,3 @@ ephy_window_get_context_event (EphyWindow *window) return window->priv->context_event; } - -- cgit