[glade] GladeCommand: ignore special child types placeholders in add command. GladeGtkWindow: mark titlebar



commit 35923d0108ed8c346adeaf72e09bb598f37f77ba
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sat May 12 10:00:18 2018 -0300

    GladeCommand: ignore special child types placeholders in add command.
    GladeGtkWindow: mark titlebar placeholder as special child type.
    
    Fix bug "Glade deletes all widgets when adding a Scrolled Window parent, but doesn't show it."
    
    https://gitlab.gnome.org/GNOME/glade/issues/196

 gladeui/glade-command.c         | 5 +++--
 plugins/gtk+/glade-gtk-window.c | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
index 25fc663d..78bd9385 100644
--- a/gladeui/glade-command.c
+++ b/gladeui/glade-command.c
@@ -1281,8 +1281,9 @@ glade_command_add (GList            *widgets,
                 {
                   child = l->data;
 
-                  /* Find a placeholder for this child */
-                  if (GLADE_IS_PLACEHOLDER (child) && 
+                  /* Find a placeholder for this child, ignore special child types */
+                  if (GLADE_IS_PLACEHOLDER (child) &&
+                      g_object_get_data (G_OBJECT (child), "special-child-type") == NULL &&
                       g_list_find (placeholders, child) == NULL)
                     {
                       placeholders = g_list_append (placeholders, child);
diff --git a/plugins/gtk+/glade-gtk-window.c b/plugins/gtk+/glade-gtk-window.c
index d8612590..a88fee82 100644
--- a/plugins/gtk+/glade-gtk-window.c
+++ b/plugins/gtk+/glade-gtk-window.c
@@ -55,6 +55,7 @@ glade_gtk_window_ensure_titlebar_placeholder (GObject *window)
     return;
 
   placeholder = glade_placeholder_new ();
+  g_object_set_data (G_OBJECT (placeholder), "special-child-type", "titlebar");
   gtk_window_set_titlebar (GTK_WINDOW (window), placeholder);
 
   gtk_widget_hide (placeholder);


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