[epiphany] ephy-find-toolbar: add a close button
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-find-toolbar: add a close button
- Date: Thu, 13 Sep 2012 18:33:58 +0000 (UTC)
commit eff14b2ff36db6d5f5e81fe47234278951677432
Author: Xan Lopez <xan igalia com>
Date: Thu Sep 13 18:11:24 2012 +0200
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
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 3f13053..c7a6312 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]