diff options
author | Diego Escalante Urrelo <descalante@igalia.com> | 2010-05-18 04:20:20 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2010-08-31 04:32:57 +0800 |
commit | ffcd483a9dc64efe1823152fb9df98f4ba67ab0f (patch) | |
tree | 6de2a8739a596037ff807b3aa9f9d2be530065b5 /src/ephy-find-toolbar.c | |
parent | a29b2c6e7561af1adc6e6a7a88f5bdf1fce2f82a (diff) | |
download | gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.tar gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.tar.gz gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.tar.bz2 gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.tar.lz gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.tar.xz gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.tar.zst gsoc2013-epiphany-ffcd483a9dc64efe1823152fb9df98f4ba67ab0f.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
Diffstat (limited to 'src/ephy-find-toolbar.c')
-rw-r--r-- | src/ephy-find-toolbar.c | 11 |
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, |