Commit 43f12233 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

Fixed loading of "special-child-type" from the catalog, fixes bugs with


	* src/glade-widget-adaptor.c: Fixed loading of "special-child-type" from
	  the catalog, fixes bugs with GtkFrame, GtkNotebook (bug 373251), GtkExpander etc.

	* src/gtk+.xml.in: Disable the "label" property of expanders, expander labels are
	  identified by thier internal label widget, when setting the "label" property the
	  widget gets lost from the hierarchy, so thats fixed (bug 386352).
parent 1752371d
2006-12-18 Tristan Van Berkom <tvb@gnome.org>
* src/glade-widget-adaptor.c: Fixed loading of "special-child-type" from
the catalog, fixes bugs with GtkFrame, GtkNotebook (bug 373251), GtkExpander etc.
* src/gtk+.xml.in: Disable the "label" property of expanders, expander labels are
identified by thier internal label widget, when setting the "label" property the
widget gets lost from the hierarchy, so thats fixed (bug 386352).
2006-12-18 Tristan Van Berkom <tvb@gnome.org>
* configure.in, NEWS: Rolling 3.1.3
......
......@@ -2771,15 +2771,15 @@ glade_gtk_expander_post_create (GladeWidgetAdaptor *adaptor,
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))
{
glabel = glade_widget_adaptor_create_widget (wadaptor, FALSE,
"parent", gexpander,
"project", glade_widget_get_project (gexpander),
NULL);
"parent", gexpander,
"project", glade_widget_get_project (gexpander),
NULL);
glade_widget_property_set (glabel, "label", "expander");
......@@ -2831,6 +2831,7 @@ glade_gtk_expander_add_child (GladeWidgetAdaptor *adaptor,
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"))
{
......
......@@ -596,7 +596,7 @@ glade_widget_adaptor_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GladeWidgetAdaptor *adaptor;
GladeWidgetAdaptor *adaptor, *parent_adaptor;
GObject *ret_obj;
GObjectClass *object_class;
......@@ -606,7 +606,8 @@ glade_widget_adaptor_constructor (GType type,
(type, n_construct_properties, construct_properties);
adaptor = GLADE_WIDGET_ADAPTOR (ret_obj);
parent_adaptor = gwa_get_parent_adaptor (adaptor);
if (adaptor->type == G_TYPE_NONE)
g_warning ("Adaptor created without a type");
if (adaptor->name == NULL)
......@@ -631,6 +632,12 @@ glade_widget_adaptor_constructor (GType type,
/* Inherit packing defaults here */
adaptor->child_packings = gwa_inherit_child_packing (adaptor);
/* Inherit special-child-type */
if (parent_adaptor)
adaptor->priv->special_child_type =
parent_adaptor->priv->special_child_type ?
g_strdup (parent_adaptor->priv->special_child_type) : NULL;
gwa_action_setup (adaptor);
return ret_obj;
......@@ -1409,7 +1416,8 @@ gwa_extend_with_node (GladeWidgetAdaptor *adaptor,
GladeWidgetAdaptorClass *adaptor_class =
GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor);
GladeXmlNode *child;
gchar *child_type;
if (module)
{
glade_xml_load_sym_from_node (node, module,
......@@ -1474,6 +1482,12 @@ gwa_extend_with_node (GladeWidgetAdaptor *adaptor,
glade_xml_get_property_boolean
(node, GLADE_XML_TAG_TOPLEVEL, adaptor_class->toplevel);
/* Override the special-child-type here */
if ((child_type =
glade_xml_get_value_string (node, GLADE_TAG_SPECIAL_CHILD_TYPE)) != NULL)
adaptor->priv->special_child_type =
(g_free (adaptor->priv->special_child_type), child_type);
/* if we found a <properties> tag on the xml file, we add the properties
* that we read from the xml file to the class.
*/
......
......@@ -1865,7 +1865,7 @@ glade_widget_set_child_type_from_child_info (GladeChildInfo *child_info,
gchar *special_child_type;
g_object_get (parent_adaptor, "special-child-type", &special_child_type, NULL);
if (!special_child_type)
return -1;
......@@ -1875,6 +1875,7 @@ glade_widget_set_child_type_from_child_info (GladeChildInfo *child_info,
if (!strcmp (prop_info->name, special_child_type))
{
g_free (special_child_type);
g_object_set_data_full (child,
"special-child-type",
g_strdup (prop_info->value),
......
......@@ -1017,7 +1017,7 @@
<special-child-type>type</special-child-type>
<properties>
<property id="label" visible="False"/>
<property id="label" disabled="True"/>
<property id="label-widget" disabled="True"/>
<!-- Atk activate property -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment