[gnome-terminal] window: Add new tab button to notebook action area



commit 62c27b6939c7b29be16191b08452e42b34ce70de
Author: Christian Persch <chpe gnome org>
Date:   Tue Jul 14 19:37:28 2015 +0200

    window: Add new tab button to notebook action area
    
    https://bugzilla.gnome.org/show_bug.cgi?id=138020

 src/terminal-window.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 3d346ae..dd0a4c4 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -35,6 +35,7 @@
 #include "terminal-debug.h"
 #include "terminal-enums.h"
 #include "terminal-encoding.h"
+#include "terminal-icon-button.h"
 #include "terminal-intl.h"
 #include "terminal-mdi-container.h"
 #include "terminal-notebook.h"
@@ -2145,6 +2146,24 @@ terminal_window_accel_activate_cb (GtkAccelGroup  *accel_group,
   return retval;
 }
 
+static void
+terminal_window_fill_notebook_action_box (TerminalWindow *window)
+{
+  TerminalWindowPrivate *priv = window->priv;
+  GtkWidget *box, *button;
+  GtkAction *action;
+
+  box = terminal_notebook_get_action_box (TERMINAL_NOTEBOOK (priv->mdi_container), GTK_PACK_END);
+
+  /* Create the NewTerminal button */
+  action = gtk_action_group_get_action (priv->action_group, "FileNewTab");
+
+  button = terminal_icon_button_new ("list-add");
+  gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action);
+  gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+  gtk_widget_show (button);
+}
+
 /*****************************************/
 
 #ifdef ENABLE_DEBUG
@@ -2710,6 +2729,8 @@ terminal_window_init (TerminalWindow *window)
 
   terminal_window_update_size_to_menu (window);
 
+  terminal_window_fill_notebook_action_box (window);
+
   /* We have to explicitly call this, since screen-changed is NOT
    * emitted for the toplevel the first time!
    */


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