aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2013-02-16 20:31:13 +0800
committerXan Lopez <xan@igalia.com>2013-02-16 20:31:13 +0800
commit9f21e02cf7a3cf2b4d68f8b051defed5457327aa (patch)
tree78e3ea5c1404215262e69ea53bcf383b3a9e30fe
parent829a5ce9beccd54958eade05ae71c7f5ed238cf3 (diff)
downloadgsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.tar
gsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.tar.gz
gsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.tar.bz2
gsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.tar.lz
gsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.tar.xz
gsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.tar.zst
gsoc2013-epiphany-9f21e02cf7a3cf2b4d68f8b051defed5457327aa.zip
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
-rw-r--r--src/ephy-toolbar.c17
-rw-r--r--src/ephy-window.c1
2 files changed, 18 insertions, 0 deletions
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, "<control>T");