From 450b7fa4b14a3de448ee2d0d60fa6901feb404a3 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Mon, 17 May 2010 15:20:20 -0500 Subject: ephy-find-toolbar: highlight matches on find_again Find next and Find previous where not highlighting matches when the find toolbar had been closed. We now trigger a highlight when the toolbar was hidden when the user requested to find again. Bug #611499 --- src/ephy-find-toolbar.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c index 114af77e2..c9fb2c458 100644 --- a/src/ephy-find-toolbar.c +++ b/src/ephy-find-toolbar.c @@ -787,6 +787,7 @@ typedef struct { EphyFindToolbar *toolbar; gboolean direction; + gboolean highlight; } FindAgainCBStruct; static void @@ -803,6 +804,11 @@ find_again_cb (FindAgainCBStruct *data) result = real_find (priv, data->direction); + /* Highlight matches again if the toolbar was hidden when the user + * requested find-again. */ + if (result != EPHY_FIND_RESULT_NOTFOUND && data->highlight) + ephy_find_toolbar_mark_matches (data->toolbar); + set_status (data->toolbar, result); priv->find_again_source_id = 0; @@ -816,8 +822,10 @@ find_again (EphyFindToolbar *toolbar, EphyFindDirection direction) GtkWidget *widget = GTK_WIDGET (toolbar); EphyFindToolbarPrivate *priv = toolbar->priv; FindAgainCBStruct *data; + gboolean visible; - if (!gtk_widget_get_visible (widget)) { + visible = gtk_widget_get_visible (widget); + if (!visible) { gtk_widget_show (widget); gtk_widget_grab_focus (widget); } @@ -831,6 +839,7 @@ find_again (EphyFindToolbar *toolbar, EphyFindDirection direction) data = g_slice_new0 (FindAgainCBStruct); data->toolbar = toolbar; data->direction = direction; + data->highlight = !visible; priv->find_again_source_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, (GSourceFunc) find_again_cb, -- cgit v1.2.3