[gnome-builder] tabs: remove unused notebooks when tab is removed.



commit 27c90c1c7d117087c7f6c1816c045748aa3ec4c7
Author: Christian Hergert <christian hergert me>
Date:   Tue Sep 9 02:07:01 2014 -0700

    tabs: remove unused notebooks when tab is removed.

 src/tabs/gb-multi-notebook.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/tabs/gb-multi-notebook.c b/src/tabs/gb-multi-notebook.c
index a7a7a7e..e5041e3 100644
--- a/src/tabs/gb-multi-notebook.c
+++ b/src/tabs/gb-multi-notebook.c
@@ -980,6 +980,17 @@ on_create_window (GtkNotebook     *notebook,
 }
 
 static void
+on_remove (GtkContainer    *container,
+           GtkWidget       *widget,
+           GbMultiNotebook *mnb)
+{
+  g_return_if_fail (GB_IS_MULTI_NOTEBOOK (mnb));
+  g_return_if_fail (GB_IS_NOTEBOOK (container));
+
+  remove_unused_notebooks (mnb);
+}
+
+static void
 connect_notebook_signals (GbMultiNotebook *self,
                           GbNotebook      *notebook)
 {
@@ -995,6 +1006,7 @@ connect_notebook_signals (GbMultiNotebook *self,
   g_signal_connect (notebook, "switch-page", G_CALLBACK (on_switch_page), self);
   g_signal_connect (notebook, "set-focus-child", G_CALLBACK (on_set_focus_child), self);
   g_signal_connect (notebook, "create-window", G_CALLBACK (on_create_window), self);
+  g_signal_connect (notebook, "remove", G_CALLBACK (on_remove), self);
 }
 
 void


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