summaryrefslogtreecommitdiff
path: root/plugins/gtk+/glade-gtk-widget.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan@upstairslabs.com>2013-12-17 18:05:50 +0900
committerTristan Van Berkom <tristan@upstairslabs.com>2013-12-17 18:05:50 +0900
commitdec1d5f838f9732d765939fb54b3b1e50f58fdbc (patch)
treecf4d94fce6c45e47019e296744f83c1c237de8fc /plugins/gtk+/glade-gtk-widget.c
parente1e318c1fc8b8fe1f009208da8d8e90efc5252d4 (diff)
downloadglade-dec1d5f838f9732d765939fb54b3b1e50f58fdbc.tar.gz
Bug 720585 - Fix order of customized property output.
Recently we split up all the adaptor code into separate files, this resulted in the above bug since the GtkWidget adaptor writes out some custom attributes in it's ->write_widget() function. Moved these Atk/StyleClasses/Accelerators to ->write_widget_after() so that they will be written after a widget's children. This fixes the GtkToolBar adaptor so that when it writes it's icon size after chaining up to the parent adaptor, it does so still inside the <properties> section of a widget.
Diffstat (limited to 'plugins/gtk+/glade-gtk-widget.c')
-rw-r--r--plugins/gtk+/glade-gtk-widget.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/gtk+/glade-gtk-widget.c b/plugins/gtk+/glade-gtk-widget.c
index e4c25d06..6bb0f9a0 100644
--- a/plugins/gtk+/glade-gtk-widget.c
+++ b/plugins/gtk+/glade-gtk-widget.c
@@ -592,14 +592,25 @@ glade_gtk_widget_write_widget (GladeWidgetAdaptor * adaptor,
if (prop && glade_property_get_enabled (prop))
glade_property_write (prop, context, node);
- /* First chain up and read in all the normal properties.. */
+ /* Finally chain up and read in all the normal properties.. */
GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
+}
- glade_gtk_write_accels (widget, context, node, TRUE);
+void
+glade_gtk_widget_write_widget_after (GladeWidgetAdaptor * adaptor,
+ GladeWidget * widget,
+ GladeXmlContext * context, GladeXmlNode * node)
+{
+ /* The ATK properties are actually children */
glade_gtk_widget_write_atk_props (widget, context, node);
+
+ /* Put the accelerators and style classes after children */
+ glade_gtk_write_accels (widget, context, node, TRUE);
glade_gtk_widget_write_style_classes (widget, context, node);
-}
+ /* Finally chain up and read in all the normal properties.. */
+ GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget_after (adaptor, widget, context, node);
+}
GladeEditorProperty *
glade_gtk_widget_create_eprop (GladeWidgetAdaptor * adaptor,