[epiphany] Add a New Tab button in the toolbar



commit 9f21e02cf7a3cf2b4d68f8b051defed5457327aa
Author: Xan Lopez <xan igalia com>
Date:   Sat Feb 16 13:31:13 2013 +0100

    Add a New Tab button in the toolbar
    
    Useful in general, and in particular in touch-based devices.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684616

 src/ephy-toolbar.c |   17 +++++++++++++++++
 src/ephy-window.c  |    1 +
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 5aa5080..870266e 100644
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -180,6 +180,23 @@ ephy_toolbar_constructed (GObject *object)
 
   gtk_widget_show_all (GTK_WIDGET (location_stop_reload));
 
+  /* New Tab */
+  tool_item = gtk_tool_item_new ();
+  tool_button = gtk_button_new ();
+  /* FIXME: apparently we need an image inside the button for the action
+   * icon to appear. */
+  gtk_button_set_image (GTK_BUTTON (tool_button), gtk_image_new ());
+  action = gtk_action_group_get_action (action_group, "FileNewTab");
+  gtk_activatable_set_related_action (GTK_ACTIVATABLE (tool_button),
+                                      action);
+  gtk_button_set_label (GTK_BUTTON (tool_button), NULL);
+  gtk_container_add (GTK_CONTAINER (tool_item), tool_button);
+  gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (tool_item));
+
+  gtk_widget_set_margin_right (GTK_WIDGET (tool_item), 4);
+  gtk_widget_show_all (GTK_WIDGET (tool_item));
+
+
   /* Page Menu */
   tool_item = gtk_tool_item_new ();
   tool_button = gtk_button_new ();
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 86503ae..a59c310 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1386,6 +1386,7 @@ setup_ui_manager (EphyWindow *window)
 
        action = g_object_new (EPHY_TYPE_HOME_ACTION,
                               "name", "FileNewTab",
+                              "icon-name", "tab-new-symbolic",
                               "label", _("New _Tab"),
                               NULL);
        gtk_action_group_add_action_with_accel (action_group, action, "<control>T");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]