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

Made toolbar-style optional & save always (plus it responds well in the


	* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Made toolbar-style
	  optional & save always (plus it responds well in the UI) (bug 382785).

	* gladeui/glade-widget.c: When building objects based on template params, 
	  dont assign properties that are disabled by GladeProperty.


svn path=/trunk/; revision=1551
parent 89a5d5f4
2007-08-14 Vincent Geddes <vgeddes@gnome.org>
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Made toolbar-style
optional & save always (plus it responds well in the UI) (bug 382785).
2007-08-14 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-widget.c: When building objects based on template params,
dont assign properties that are disabled by GladeProperty.
2007-08-08 Yevgen Muntyan <muntyan@tamu.edu>
* gladeui/glade-builtins.c, gladeui/glade-design-layout.c:
......
......@@ -466,7 +466,8 @@ glade_widget_template_params (GladeWidget *widget,
/* Ignore properties based on some criteria
*/
if (pclass == NULL || /* Unaccounted for in the builder */
if (!glade_property_get_enabled (glade_property) ||
pclass == NULL || /* Unaccounted for in the builder */
pclass->virt || /* should not be set before
GladeWidget wrapper exists */
pclass->ignore) /* Catalog explicitly ignores the object */
......
......@@ -5478,6 +5478,40 @@ glade_gtk_menu_bar_post_create (GladeWidgetAdaptor *adaptor,
}
/* ----------------------------- GtkToolBar ------------------------------ */
/* need to unset/reset toolbar style when property is disabled/enabled */
static void
property_toolbar_style_notify_enabled (GladeProperty *property,
GParamSpec *spec,
GtkToolbar *toolbar)
{
GtkToolbarStyle style;
if (glade_property_get_enabled (property))
{
glade_property_get (property, &style);
gtk_toolbar_set_style (toolbar, style);
}
else
gtk_toolbar_unset_style (toolbar);
}
void
glade_gtk_toolbar_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
GladeWidget *widget;
GladeProperty *toolbar_style_property;
widget = glade_widget_get_from_gobject (object);
toolbar_style_property = glade_widget_get_property (widget, "toolbar-style");
g_signal_connect (toolbar_style_property, "notify::enabled",
G_CALLBACK (property_toolbar_style_notify_enabled),
object);
}
void
glade_gtk_toolbar_get_child_property (GladeWidgetAdaptor *adaptor,
GObject *container,
......@@ -5495,11 +5529,12 @@ glade_gtk_toolbar_get_child_property (GladeWidgetAdaptor *adaptor,
GTK_TOOL_ITEM (child)));
}
else
/* Chain Up */
{ /* Chain Up */
GWA_GET_CLASS
(GTK_TYPE_CONTAINER)->child_get_property (adaptor,
container, child,
property_name, value);
}
}
void
......
......@@ -431,7 +431,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkToolbar" generic-name="toolbar" _title="Tool Bar" use-placeholders="False">
<post-create-function>empty</post-create-function>
<post-create-function>glade_gtk_toolbar_post_create</post-create-function>
<add-child-function>glade_gtk_toolbar_add_child</add-child-function>
<remove-child-function>glade_gtk_toolbar_remove_child</remove-child-function>
<child-set-property-function>glade_gtk_toolbar_set_child_property</child-set-property-function>
......@@ -448,7 +448,7 @@ embedded in another object</_tooltip>
<value id="GTK_ORIENTATION_VERTICAL" _name="Vertical"/>
</displayable-values>
</property>
<property id="toolbar-style">
<property id="toolbar-style" save-always="True" optional="True" optional-default="False">
<displayable-values>
<value id="GTK_TOOLBAR_ICONS" _name="Icons only"/>
<value id="GTK_TOOLBAR_TEXT" _name="Text only"/>
......
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