[epiphany/gnome-2-30] ephy-find-toolbar: highlight matches on find_again
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-2-30] ephy-find-toolbar: highlight matches on find_again
- Date: Mon, 30 Aug 2010 21:00:45 +0000 (UTC)
commit ffcd483a9dc64efe1823152fb9df98f4ba67ab0f
Author: Diego Escalante Urrelo <descalante igalia com>
Date: Mon May 17 15:20:20 2010 -0500
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 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c
index 114af77..c9fb2c4 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]