diff options
author | Tristan Van Berkom <tvb@src.gnome.org> | 2007-08-07 17:03:52 +0000 |
---|---|---|
committer | Tristan Van Berkom <tvb@src.gnome.org> | 2007-08-07 17:03:52 +0000 |
commit | e725eccca3a5c58ca3b2e001976ed9932e194e2f (patch) | |
tree | 45b81f2331ee518aab708ce5f574300aa4627801 | |
parent | 0a346340afa2bbc446358240fd0eb85a1589aecd (diff) | |
download | glade-e725eccca3a5c58ca3b2e001976ed9932e194e2f.tar.gz |
glade_editor_property_new_from_widget() added "packing" argument.
* gladeui/glade-editor-property.[ch]: glade_editor_property_new_from_widget() added
"packing" argument.
* gladeui/glade-base-editor.[ch]: Fixed va_start() without va_end() in
glade_base_editor_add_properties(), also added "packing" argument to
glade_base_editor_add_properties().
* plugins/gtk+/glade-gtk.c: Added "expand" and "homogeneous" packing properties
to toolbar children in the toolbar editor (bug 429409).
svn path=/trunk/; revision=1539
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | gladeui/glade-base-editor.c | 9 | ||||
-rw-r--r-- | gladeui/glade-base-editor.h | 1 | ||||
-rw-r--r-- | gladeui/glade-editor-property.c | 9 | ||||
-rw-r--r-- | gladeui/glade-editor-property.h | 1 | ||||
-rw-r--r-- | plugins/gtk+/glade-gtk.c | 21 |
6 files changed, 38 insertions, 13 deletions
@@ -2,6 +2,16 @@ * configure.ac: Removed bogus output about python bindings. + * gladeui/glade-editor-property.[ch]: glade_editor_property_new_from_widget() added + "packing" argument. + + * gladeui/glade-base-editor.[ch]: Fixed va_start() without va_end() in + glade_base_editor_add_properties(), also added "packing" argument to + glade_base_editor_add_properties(). + + * plugins/gtk+/glade-gtk.c: Added "expand" and "homogeneous" packing properties + to toolbar children in the toolbar editor (bug 429409). + 2006-08-06 Tristan Van Berkom <tvb@gnome.org> * plugins/gtk+/gtk+.xml.in: Disabled the "submenu" property of GtkMenuItem diff --git a/gladeui/glade-base-editor.c b/gladeui/glade-base-editor.c index 88758390..a9048ee5 100644 --- a/gladeui/glade-base-editor.c +++ b/gladeui/glade-base-editor.c @@ -1634,6 +1634,7 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor, * glade_base_editor_add_properties: * @editor: a #GladeBaseEditor * @gchild: a #GladeWidget + * @packing: whether we are adding packing properties or not * @...: A NULL terminated list of properties names. * * Add @gchild properties to @editor @@ -1642,7 +1643,8 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor, */ void glade_base_editor_add_properties (GladeBaseEditor *editor, - GladeWidget *gchild, + GladeWidget *gchild, + gboolean packing, ...) { GladeEditorProperty *eprop; @@ -1652,18 +1654,19 @@ glade_base_editor_add_properties (GladeBaseEditor *editor, g_return_if_fail (GLADE_IS_BASE_EDITOR (editor)); g_return_if_fail (GLADE_IS_WIDGET (gchild)); - va_start (args, gchild); + va_start (args, packing); property = va_arg (args, gchar *); while (property) { - eprop = glade_editor_property_new_from_widget (gchild, property, TRUE); + eprop = glade_editor_property_new_from_widget (gchild, property, packing, TRUE); if (eprop) glade_base_editor_table_attach (editor, GLADE_EDITOR_PROPERTY (eprop)->eventbox, GTK_WIDGET (eprop)); property = va_arg (args, gchar *); } + va_end (args); } /** diff --git a/gladeui/glade-base-editor.h b/gladeui/glade-base-editor.h index bf8cdc62..e19d479d 100644 --- a/gladeui/glade-base-editor.h +++ b/gladeui/glade-base-editor.h @@ -71,6 +71,7 @@ void glade_base_editor_add_default_properties (GladeBaseEditor * void glade_base_editor_add_properties (GladeBaseEditor *editor, GladeWidget *gchild, + gboolean packing, ...); void glade_base_editor_add_label (GladeBaseEditor *editor, diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c index 7ad18fbd..ede36e40 100644 --- a/gladeui/glade-editor-property.c +++ b/gladeui/glade-editor-property.c @@ -3764,6 +3764,7 @@ glade_editor_property_new (GladePropertyClass *klass, * glade_editor_property_new_from_widget: * @widget: A #GladeWidget * @property: The widget's property + * @packing: whether @property indicates a packing property or not. * @use_command: Whether the undo/redo stack applies here. * * This is a convenience function to create a GladeEditorProperty corresponding @@ -3774,12 +3775,16 @@ glade_editor_property_new (GladePropertyClass *klass, GladeEditorProperty * glade_editor_property_new_from_widget (GladeWidget *widget, const gchar *property, - gboolean use_command) + gboolean packing, + gboolean use_command) { GladeEditorProperty *eprop; GladeProperty *p; - p = glade_widget_get_property (widget, property); + if (packing) + p = glade_widget_get_pack_property (widget, property); + else + p = glade_widget_get_property (widget, property); g_return_val_if_fail (GLADE_IS_PROPERTY (p), NULL); eprop = glade_editor_property_new (p->klass, use_command); diff --git a/gladeui/glade-editor-property.h b/gladeui/glade-editor-property.h index 5e2a7fc2..d9e39742 100644 --- a/gladeui/glade-editor-property.h +++ b/gladeui/glade-editor-property.h @@ -87,6 +87,7 @@ GladeEditorProperty *glade_editor_property_new (GladePropertyClass * GladeEditorProperty *glade_editor_property_new_from_widget (GladeWidget *widget, const gchar *property, + gboolean packing, gboolean use_command); void glade_editor_property_load (GladeEditorProperty *eprop, diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c index d33725ba..a3e48ce3 100644 --- a/plugins/gtk+/glade-gtk.c +++ b/plugins/gtk+/glade-gtk.c @@ -4755,14 +4755,14 @@ glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor, glade_base_editor_add_label (editor, "Properties"); - glade_base_editor_add_properties (editor, gchild, "label", "tooltip", NULL); + glade_base_editor_add_properties (editor, gchild, FALSE, "label", "tooltip", NULL); if (type == GTK_TYPE_IMAGE_MENU_ITEM) { GtkWidget *image; GladeWidget *internal; - glade_base_editor_add_properties (editor, gchild, "stock", NULL); + glade_base_editor_add_properties (editor, gchild, FALSE, "stock", NULL); if ((image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (child)))) { @@ -4772,17 +4772,17 @@ glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor, glade_base_editor_add_label (editor, "Internal Image Properties"); glade_base_editor_add_properties - (editor, internal, "glade-type", "pixbuf", + (editor, internal, FALSE, "glade-type", "pixbuf", "glade-stock", "icon-name", NULL); } } } else if (type == GTK_TYPE_CHECK_MENU_ITEM) - glade_base_editor_add_properties (editor, gchild, + glade_base_editor_add_properties (editor, gchild, FALSE, "active", "draw-as-radio", "inconsistent", NULL); else if (type == GTK_TYPE_RADIO_MENU_ITEM) - glade_base_editor_add_properties (editor, gchild, + glade_base_editor_add_properties (editor, gchild, FALSE, "active", "group", NULL); } @@ -5607,7 +5607,7 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor, glade_base_editor_add_label (editor, "Properties"); - glade_base_editor_add_properties (editor, gchild, + glade_base_editor_add_properties (editor, gchild, FALSE, "visible-horizontal", "visible-vertical", NULL); @@ -5615,7 +5615,7 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor, if (type == GTK_TYPE_SEPARATOR_TOOL_ITEM) return; if (GTK_IS_TOOL_BUTTON (child)) - glade_base_editor_add_properties (editor, gchild, + glade_base_editor_add_properties (editor, gchild, FALSE, "label", "glade-type", "icon", @@ -5624,8 +5624,13 @@ glade_gtk_toolbar_child_selected (GladeBaseEditor *editor, NULL); if (type == GTK_TYPE_RADIO_TOOL_BUTTON) - glade_base_editor_add_properties (editor, gchild, + glade_base_editor_add_properties (editor, gchild, FALSE, "group", "active", NULL); + + glade_base_editor_add_label (editor, "Packing"); + glade_base_editor_add_properties (editor, gchild, TRUE, + "expand", "homogeneous", NULL); + } static void |