aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-find-toolbar.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-01-04 20:25:42 +0800
committerChristian Persch <chpe@src.gnome.org>2006-01-04 20:25:42 +0800
commitce41d0f2c6becdb0032813f8917ff82e984b860f (patch)
treebc6f51198b6a6ddfa0f615870fa7ac52dde46293 /src/ephy-find-toolbar.c
parent9c35bf08fb67fc9b74da029f00c699dbd1fd200a (diff)
downloadgsoc2013-epiphany-ce41d0f2c6becdb0032813f8917ff82e984b860f.tar.gz
gsoc2013-epiphany-ce41d0f2c6becdb0032813f8917ff82e984b860f.tar.zst
gsoc2013-epiphany-ce41d0f2c6becdb0032813f8917ff82e984b860f.zip
Fix warning when Ctrl-F while the find toolbar is already shown. Fix
2006-01-04 Christian Persch <chpe@cvs.gnome.org> * src/ephy-find-toolbar.c: (entry_changed_cb), (set_focus_cb), (ephy_find_toolbar_grab_focus), (ephy_find_toolbar_find_next), (ephy_find_toolbar_find_previous), (ephy_find_toolbar_open), (ephy_find_toolbar_close): Fix warning when Ctrl-F while the find toolbar is already shown. Fix next/prev button sensitivity when find wrapped around. * src/ephy-window.c: Add more XF86XK key codes.
Diffstat (limited to 'src/ephy-find-toolbar.c')
-rw-r--r--src/ephy-find-toolbar.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c
index d20aa8a2c..c18b47de5 100644
--- a/src/ephy-find-toolbar.c
+++ b/src/ephy-find-toolbar.c
@@ -57,7 +57,6 @@ struct _EphyFindToolbarPrivate
guint preedit_changed : 1;
guint prevent_activate : 1;
guint activated : 1;
- guint explicit_focus : 1;
guint links_only : 1;
guint typing_ahead : 1;
};
@@ -232,7 +231,7 @@ entry_changed_cb (GtkEntry *entry,
#ifdef HAVE_TYPEAHEADFIND
result = ephy_embed_find_find (get_find (toolbar), text, priv->links_only);
- found = result == EPHY_EMBED_FIND_FOUND;
+ found = result != EPHY_EMBED_FIND_NOTFOUND;
set_status (toolbar, result);
#endif
set_controls (toolbar, found, found);
@@ -309,7 +308,6 @@ set_focus_cb (EphyWindow *window,
GtkWidget *widget,
EphyFindToolbar *toolbar)
{
- EphyFindToolbarPrivate *priv = toolbar->priv;
GtkWidget *wtoolbar = GTK_WIDGET (toolbar);
while (widget != NULL && widget != wtoolbar)
@@ -318,11 +316,7 @@ set_focus_cb (EphyWindow *window,
}
/* if widget == toolbar, the new focus widget is in the toolbar */
- if (widget == wtoolbar)
- {
- priv->explicit_focus = TRUE;
- }
- else if (priv->explicit_focus)
+ if (widget != wtoolbar)
{
ephy_find_toolbar_request_close (toolbar);
}
@@ -361,7 +355,6 @@ ephy_find_toolbar_grab_focus (GtkWidget *widget)
EphyFindToolbarPrivate *priv = toolbar->priv;
gtk_widget_grab_focus (GTK_WIDGET (priv->entry));
- g_return_if_fail (priv->explicit_focus);
}
static void
@@ -635,7 +628,7 @@ ephy_find_toolbar_find_next (EphyFindToolbar *toolbar)
result = ephy_embed_find_find_again (get_find (toolbar), TRUE);
- found = result == EPHY_EMBED_FIND_FOUND;
+ found = result != EPHY_EMBED_FIND_NOTFOUND;
set_controls (toolbar, found, found);
set_status (toolbar, result);
}
@@ -647,7 +640,7 @@ ephy_find_toolbar_find_previous (EphyFindToolbar *toolbar)
gboolean found;
result = ephy_embed_find_find_again (get_find (toolbar), FALSE);
- found = result == EPHY_EMBED_FIND_FOUND;
+ found = result != EPHY_EMBED_FIND_NOTFOUND;
set_controls (toolbar, found, found);
set_status (toolbar, result);
}
@@ -664,7 +657,6 @@ ephy_find_toolbar_open (EphyFindToolbar *toolbar,
priv->typing_ahead = typing_ahead;
priv->links_only = links_only;
- priv->explicit_focus = FALSE;
clear_status (toolbar);
@@ -687,9 +679,6 @@ ephy_find_toolbar_close (EphyFindToolbar *toolbar)
{
EphyFindToolbarPrivate *priv = toolbar->priv;
- /* first unset explicit_focus, else we get infinite recursion */
- priv->explicit_focus = FALSE;
-
gtk_widget_hide (GTK_WIDGET (toolbar));
if (priv->embed == NULL || priv->find == NULL) return;