diff options
author | Xan Lopez <xan@igalia.com> | 2012-09-14 00:11:24 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-09-14 00:11:24 +0800 |
commit | eff14b2ff36db6d5f5e81fe47234278951677432 (patch) | |
tree | 0b9af4ca1b5b2485ef19432c5bc346f73f4dcacc | |
parent | ede0d69c6922376cbbebe26bb99673208d38ff55 (diff) | |
download | gsoc2013-epiphany-eff14b2ff36db6d5f5e81fe47234278951677432.tar.gz gsoc2013-epiphany-eff14b2ff36db6d5f5e81fe47234278951677432.tar.zst gsoc2013-epiphany-eff14b2ff36db6d5f5e81fe47234278951677432.zip |
ephy-find-toolbar: add a close button
There was no way to close the toolbar from the UI itself.
https://bugzilla.gnome.org/show_bug.cgi?id=683967
-rw-r--r-- | src/ephy-find-toolbar.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c index 3f13053f8..c7a631296 100644 --- a/src/ephy-find-toolbar.c +++ b/src/ephy-find-toolbar.c @@ -607,13 +607,19 @@ ephy_find_toolbar_grab_focus (GtkWidget *widget) } static void +close_button_clicked_cb (GtkButton *button, EphyFindToolbar *toolbar) +{ + ephy_find_toolbar_request_close (toolbar); +} + +static void ephy_find_toolbar_init (EphyFindToolbar *toolbar) { EphyFindToolbarPrivate *priv; GtkToolbar *gtoolbar; GtkToolItem *item; GtkWidget *alignment, *arrow, *box; - GtkWidget *checkbox; + GtkWidget *checkbox, *close_button, *image; priv = toolbar->priv = EPHY_FIND_TOOLBAR_GET_PRIVATE (toolbar); gtoolbar = GTK_TOOLBAR (toolbar); @@ -627,6 +633,12 @@ ephy_find_toolbar_init (EphyFindToolbar *toolbar) box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_add (GTK_CONTAINER (alignment), box); + close_button = gtk_button_new (); + image = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE); + gtk_container_add (GTK_CONTAINER (close_button), image); + gtk_box_pack_start (GTK_BOX (box), close_button, FALSE, FALSE, 0); + priv->label = gtk_label_new (NULL); gtk_box_pack_start (GTK_BOX (box), priv->label, FALSE, FALSE, 0); @@ -696,6 +708,8 @@ ephy_find_toolbar_init (EphyFindToolbar *toolbar) G_CALLBACK (find_prev_cb), toolbar); g_signal_connect (priv->case_sensitive, "toggled", G_CALLBACK (case_sensitive_toggled_cb), toolbar); + g_signal_connect (close_button, "clicked", + G_CALLBACK (close_button_clicked_cb), toolbar); } G_DEFINE_TYPE (EphyFindToolbar, ephy_find_toolbar, GTK_TYPE_TOOLBAR) |