diff options
author | Tristan Van Berkom <tvb@src.gnome.org> | 2006-08-18 17:00:22 +0000 |
---|---|---|
committer | Tristan Van Berkom <tvb@src.gnome.org> | 2006-08-18 17:00:22 +0000 |
commit | 7c90674ca2b334a8b753bdcd116d2c51467b52bd (patch) | |
tree | 922308f51f831c2b849aefde3d7f8da1f0baa820 | |
parent | affc8a7fac2c79839063e74049d09c4187ec8648 (diff) | |
download | glade-7c90674ca2b334a8b753bdcd116d2c51467b52bd.tar.gz |
Fixed expanders, now there's always a placehodler when needed.
* src/glade-gtk.c, widgets/gtk+.xml.in: Fixed expanders,
now there's always a placehodler when needed.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/glade-gtk.c | 30 | ||||
-rw-r--r-- | widgets/gtk+.xml.in | 1 |
4 files changed, 35 insertions, 4 deletions
@@ -1,4 +1,9 @@ -2006-08-11 Tristan Van Berkom <tvb@gnome.org> +2006-08-18 Tristan Van Berkom <tvb@gnome.org> + + * src/glade-gtk.c, widgets/gtk+.xml.in: Fixed expanders, + now there's always a placehodler when needed. + +2006-08-17 Tristan Van Berkom <tvb@gnome.org> * src/glade-command.c: Now you can paste widgets to your hearts content. (bug 345603) @@ -1,7 +1,6 @@ 3.0.1 Bugfix release menu: ========================== - - Expanders have no placeholders ! - Interface signals - Need to order properties in the editor (part of bug 345893) - SHIFT-click on palette items should make them "stick" (bug 303679) diff --git a/src/glade-gtk.c b/src/glade-gtk.c index 572663bf..3530bc34 100644 --- a/src/glade-gtk.c +++ b/src/glade-gtk.c @@ -2495,7 +2495,7 @@ glade_gtk_expander_post_create (GObject *expander, GladeCreateReason reason) g_return_if_fail (GTK_IS_EXPANDER (expander)); gexpander = glade_widget_get_from_gobject (expander); g_return_if_fail (GLADE_IS_WIDGET (gexpander)); - + /* If we didnt put this object here... */ if ((label = gtk_expander_get_label_widget (GTK_EXPANDER (expander))) == NULL || (glade_widget_get_from_gobject (label) == NULL)) @@ -2513,6 +2513,11 @@ glade_gtk_expander_post_create (GObject *expander, GladeCreateReason reason) gtk_widget_show (GTK_WIDGET (glabel->object)); } + + gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE); + + gtk_container_add (GTK_CONTAINER (expander), glade_placeholder_new ()); + } void GLADEGTK_API @@ -2550,8 +2555,29 @@ glade_gtk_expander_add_child (GObject *object, GObject *child) } else { + glade_gtk_container_add_child (GTK_WIDGET (object), + GTK_WIDGET (child)); + } +} + +void GLADEGTK_API +glade_gtk_expander_remove_child (GObject *object, GObject *child) +{ + gchar *special_child_type; + + special_child_type = g_object_get_data (child, "special-child-type"); + if (special_child_type && + !strcmp (special_child_type, "label_item")) + { + gtk_expander_set_label_widget (GTK_EXPANDER (object), + glade_placeholder_new ()); + } + else + { + gtk_container_remove (GTK_CONTAINER (object), + GTK_WIDGET (child)); gtk_container_add (GTK_CONTAINER (object), - GTK_WIDGET (child)); + glade_placeholder_new ()); } } diff --git a/widgets/gtk+.xml.in b/widgets/gtk+.xml.in index c217effd..84168a50 100644 --- a/widgets/gtk+.xml.in +++ b/widgets/gtk+.xml.in @@ -1084,6 +1084,7 @@ <type>GtkWidget</type> <special-child-type>type</special-child-type> <add-child-function>glade_gtk_expander_add_child</add-child-function> + <remove-child-function>glade_gtk_expander_remove_child</remove-child-function> <replace-child-function>glade_gtk_expander_replace_child</replace-child-function> </child> </children> |