Commit e725eccc authored by Tristan Van Berkom's avatar Tristan Van Berkom

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
parent 0a346340
......@@ -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
......
......@@ -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
......@@ -1643,6 +1644,7 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
void
glade_base_editor_add_properties (GladeBaseEditor *editor,
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);
}
/**
......
......@@ -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,
......
......@@ -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,11 +3775,15 @@ glade_editor_property_new (GladePropertyClass *klass,
GladeEditorProperty *
glade_editor_property_new_from_widget (GladeWidget *widget,
const gchar *property,
gboolean packing,
gboolean use_command)
{
GladeEditorProperty *eprop;
GladeProperty *p;
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);
......
......@@ -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,
......
......@@ -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
......
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