[gnome-builder/wip/chergert/debugger: 68/86] pnl: give access to panels via internal-child



commit 64a17a5b5cbffc290c2071c8d7359bda89a4de73
Author: Christian Hergert <chergert redhat com>
Date:   Sun Mar 26 16:40:24 2017 -0700

    pnl: give access to panels via internal-child
    
    This allows panels to be shown using reveal-child on the internal child.

 contrib/pnl/pnl-dock-bin.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/contrib/pnl/pnl-dock-bin.c b/contrib/pnl/pnl-dock-bin.c
index 097580b..69dded8 100644
--- a/contrib/pnl/pnl-dock-bin.c
+++ b/contrib/pnl/pnl-dock-bin.c
@@ -1824,10 +1824,31 @@ pnl_dock_bin_add_child (GtkBuildable *buildable,
     gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (child));
 }
 
+static GObject *
+pnl_dock_bin_get_internal_child (GtkBuildable *buildable,
+                                 GtkBuilder   *builder,
+                                 const gchar  *childname)
+{
+  PnlDockBin *self = (PnlDockBin *)buildable;
+
+  g_assert (PNL_IS_DOCK_BIN (self));
+  g_assert (GTK_IS_BUILDER (builder));
+
+  if (g_strcmp0 ("top", childname) == 0)
+    return G_OBJECT (pnl_dock_bin_get_top_edge (self));
+  else if (g_strcmp0 ("bottom", childname) == 0)
+    return G_OBJECT (pnl_dock_bin_get_bottom_edge (self));
+  else if (g_strcmp0 ("right", childname) == 0)
+    return G_OBJECT (pnl_dock_bin_get_right_edge (self));
+
+  return NULL;
+}
+
 static void
 pnl_dock_bin_init_buildable_iface (GtkBuildableIface *iface)
 {
   iface->add_child = pnl_dock_bin_add_child;
+  iface->get_internal_child = pnl_dock_bin_get_internal_child;
 }
 
 static void


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