From 9f21e02cf7a3cf2b4d68f8b051defed5457327aa Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sat, 16 Feb 2013 13:31:13 +0100 Subject: 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(+) diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c index 5aa50803b..870266efd 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 86503aeb1..a59c310d0 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, "T"); -- cgit v1.2.3