[glade] Bug 720585 - Fix order of customized property output.



commit dec1d5f838f9732d765939fb54b3b1e50f58fdbc
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Tue Dec 17 18:05:50 2013 +0900

    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.

 plugins/gtk+/glade-gtk-widget.c |   17 ++++++++++++++---
 plugins/gtk+/gtk+.xml.in        |    1 +
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-widget.c b/plugins/gtk+/glade-gtk-widget.c
index e4c25d0..6bb0f9a 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,
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index a42cd49..184268e 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -17,6 +17,7 @@
       <action-submenu-function>glade_gtk_widget_action_submenu</action-submenu-function>
       <read-widget-function>glade_gtk_widget_read_widget</read-widget-function>
       <write-widget-function>glade_gtk_widget_write_widget</write-widget-function>
+      <write-widget-after-function>glade_gtk_widget_write_widget_after</write-widget-after-function>
       <create-editor-property-function>glade_gtk_widget_create_eprop</create-editor-property-function>
       <create-editable-function>glade_gtk_widget_create_editable</create-editable-function>
       <string-from-value-function>glade_gtk_widget_string_from_value</string-from-value-function>


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