aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-05-18 04:20:20 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-05-19 01:38:47 +0800
commit450b7fa4b14a3de448ee2d0d60fa6901feb404a3 (patch)
treecfd98cebb260001c6c88ef57861cf71d2c3ad824
parent27b78a446f25edf50db8acd38854a3bc937af32f (diff)
downloadgsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.tar
gsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.tar.gz
gsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.tar.bz2
gsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.tar.lz
gsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.tar.xz
gsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.tar.zst
gsoc2013-epiphany-450b7fa4b14a3de448ee2d0d60fa6901feb404a3.zip
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
-rw-r--r--src/ephy-find-toolbar.c11
1 files changed, 10 insertions, 1 deletions
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,