[gnome-builder] notebook: cleanup



commit b0504001988226a21884da7b05feed18a8c5a7e0
Author: Christian Hergert <christian hergert me>
Date:   Sat Oct 4 15:31:13 2014 -0700

    notebook: cleanup

 src/tabs/gb-multi-notebook.c |   10 +++++-----
 src/tabs/gb-notebook.c       |    8 +++-----
 2 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/tabs/gb-multi-notebook.c b/src/tabs/gb-multi-notebook.c
index 39da7c5..79e5be1 100644
--- a/src/tabs/gb-multi-notebook.c
+++ b/src/tabs/gb-multi-notebook.c
@@ -488,7 +488,10 @@ get_drag_drop_target_area (GbMultiNotebook *mnb,
   priv = mnb->priv;
 
   gtk_widget_get_allocation (GTK_WIDGET (priv->drag_drop_target), &alloc);
-  gtk_widget_translate_coordinates (GTK_WIDGET (priv->drag_drop_target), GTK_WIDGET (mnb), alloc.x, alloc.y, 
&alloc.x, &alloc.y);
+  gtk_widget_translate_coordinates (GTK_WIDGET (priv->drag_drop_target),
+                                    GTK_WIDGET (mnb),
+                                    alloc.x, alloc.y,
+                                    &alloc.x, &alloc.y);
 
   if (priv->drag_drop_position == -1)
     {
@@ -944,10 +947,7 @@ on_set_focus_child (GbNotebook      *notebook,
   if (GB_IS_TAB (widget))
     tab = GB_TAB (widget);
   else if (GB_IS_TAB_LABEL (widget))
-    {
-      tab = g_object_get_data (G_OBJECT (widget), "GB_TAB");
-      g_assert (GB_IS_TAB (tab));
-    }
+    tab = gb_tab_label_get_tab (GB_TAB_LABEL (widget));
 
   if (tab)
     {
diff --git a/src/tabs/gb-notebook.c b/src/tabs/gb-notebook.c
index 76f0412..605d0f4 100644
--- a/src/tabs/gb-notebook.c
+++ b/src/tabs/gb-notebook.c
@@ -75,10 +75,9 @@ gb_notebook_tab_label_close_clicked (GbNotebook *notebook,
   g_return_if_fail (GB_IS_NOTEBOOK (notebook));
   g_return_if_fail (GB_IS_TAB_LABEL (tab_label));
 
-  tab = g_object_get_data (G_OBJECT (tab_label), "GB_TAB");
-  g_assert (GB_IS_TAB (tab));
-
-  gb_tab_close (tab);
+  tab = gb_tab_label_get_tab (tab_label);
+  if (tab)
+    gb_tab_close (tab);
 
   EXIT;
 }
@@ -96,7 +95,6 @@ gb_notebook_add_tab (GbNotebook *notebook,
                              "tab", tab,
                              "visible", TRUE,
                              NULL);
-   g_object_set_data (G_OBJECT (tab_label), "GB_TAB", tab);
    g_signal_connect_object (tab_label,
                             "close-clicked",
                             G_CALLBACK (gb_notebook_tab_label_close_clicked),


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