[gnome-builder] glade: expand inspector treeview when displaying popover



commit 7e9e4226c7a9f1f55a72b9d20a6de57d844e1512
Author: Christian Hergert <chergert redhat com>
Date:   Mon Oct 22 11:18:33 2018 -0700

    glade: expand inspector treeview when displaying popover
    
    This makes the visibility more similar to what we do with the symbol
    popover, which is the closest metaphor here.

 src/plugins/glade/gbp-glade-layout-stack-addin.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/src/plugins/glade/gbp-glade-layout-stack-addin.c 
b/src/plugins/glade/gbp-glade-layout-stack-addin.c
index 666fd2890..32d396c10 100644
--- a/src/plugins/glade/gbp-glade-layout-stack-addin.c
+++ b/src/plugins/glade/gbp-glade-layout-stack-addin.c
@@ -127,6 +127,18 @@ gbp_glade_layout_stack_addin_init (GbpGladeLayoutStackAddin *self)
                                    G_CONNECT_SWAPPED);
 }
 
+static void
+on_popover_show_cb (GtkPopover *popover,
+                    gpointer    user_data)
+{
+  GtkTreeView *tree;
+
+  g_assert (GTK_IS_POPOVER (popover));
+
+  tree = dzl_gtk_widget_find_child_typed (GTK_WIDGET (popover), GTK_TYPE_TREE_VIEW);
+  gtk_tree_view_expand_all (tree);
+}
+
 static void
 gbp_glade_layout_stack_addin_load (IdeLayoutStackAddin *addin,
                                    IdeLayoutStack      *stack)
@@ -146,6 +158,10 @@ gbp_glade_layout_stack_addin_load (IdeLayoutStackAddin *addin,
                           "height-request", 400,
                           "position", GTK_POS_BOTTOM,
                           NULL);
+  g_signal_connect (popover,
+                    "show",
+                    G_CALLBACK (on_popover_show_cb),
+                    NULL);
   dzl_gtk_widget_add_style_class (GTK_WIDGET (popover), "glade-stack-header");
 
   self->button = g_object_new (GTK_TYPE_MENU_BUTTON,


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