[evince] eggfindbar: don't close the findbar when it loses the focus
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] eggfindbar: don't close the findbar when it loses the focus
- Date: Fri, 28 Jun 2013 09:41:21 +0000 (UTC)
commit a2d781fb124bd19861035fd41dacc976e00d19ef
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sun Jun 23 12:31:52 2013 +0200
eggfindbar: don't close the findbar when it loses the focus
Now that there's a toggle button in the toolbar, the find bar can be
closed just by toggling the button.
shell/eggfindbar.c | 67 ----------------------------------------------------
1 files changed, 0 insertions(+), 67 deletions(-)
---
diff --git a/shell/eggfindbar.c b/shell/eggfindbar.c
index 5eafd92..1e51314 100644
--- a/shell/eggfindbar.c
+++ b/shell/eggfindbar.c
@@ -37,7 +37,6 @@ struct _EggFindBarPrivate
GtkWidget *find_entry;
GtkWidget *status_label;
- gulong set_focus_handler;
guint case_sensitive : 1;
guint case_sensitive_enabled : 1;
guint whole_words_only : 1;
@@ -62,8 +61,6 @@ static void egg_find_bar_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
-static void egg_find_bar_show (GtkWidget *widget);
-static void egg_find_bar_hide (GtkWidget *widget);
static void egg_find_bar_grab_focus (GtkWidget *widget);
G_DEFINE_TYPE (EggFindBar, egg_find_bar, GTK_TYPE_TOOLBAR);
@@ -96,9 +93,6 @@ egg_find_bar_class_init (EggFindBarClass *klass)
object_class->finalize = egg_find_bar_finalize;
- widget_class->show = egg_find_bar_show;
- widget_class->hide = egg_find_bar_hide;
-
widget_class->grab_focus = egg_find_bar_grab_focus;
find_bar_signals[NEXT] =
@@ -360,27 +354,6 @@ entry_changed_callback (GtkEntry *entry,
}
static void
-set_focus_cb (GtkWidget *window,
- GtkWidget *widget,
- EggFindBar *bar)
-{
- GtkWidget *wbar = GTK_WIDGET (bar);
-
- while (widget != NULL && widget != wbar)
- {
- widget = gtk_widget_get_parent (widget);
- }
-
- /* if widget == bar, the new focus widget is in the bar, so we
- * don't deactivate.
- */
- if (widget != wbar)
- {
- g_signal_emit (bar, find_bar_signals[CLOSE], 0);
- }
-}
-
-static void
egg_find_bar_init (EggFindBar *find_bar)
{
EggFindBarPrivate *priv;
@@ -542,46 +515,6 @@ egg_find_bar_get_property (GObject *object,
}
static void
-egg_find_bar_show (GtkWidget *widget)
-{
- EggFindBar *bar = EGG_FIND_BAR (widget);
- EggFindBarPrivate *priv = bar->priv;
-
- GTK_WIDGET_CLASS (egg_find_bar_parent_class)->show (widget);
-
- if (priv->set_focus_handler == 0)
- {
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel (widget);
-
- priv->set_focus_handler =
- g_signal_connect (toplevel, "set-focus",
- G_CALLBACK (set_focus_cb), bar);
- }
-}
-
-static void
-egg_find_bar_hide (GtkWidget *widget)
-{
- EggFindBar *bar = EGG_FIND_BAR (widget);
- EggFindBarPrivate *priv = bar->priv;
-
- if (priv->set_focus_handler != 0)
- {
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel (widget);
-
- g_signal_handlers_disconnect_by_func
- (toplevel, (void (*)) G_CALLBACK (set_focus_cb), bar);
- priv->set_focus_handler = 0;
- }
-
- GTK_WIDGET_CLASS (egg_find_bar_parent_class)->hide (widget);
-}
-
-static void
egg_find_bar_grab_focus (GtkWidget *widget)
{
EggFindBar *find_bar = EGG_FIND_BAR (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]