Commit 9138bc59 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Fixed placeholder menu to also include actions of the parent widget.


	* gladeui/glade-popup.c: Fixed placeholder menu to also include actions of the
	  parent widget.

	  - Disable Add/Remove parent actions on GtkToolItem, GtkMenu and GtkMenuItem.


svn path=/trunk/; revision=1518
parent 7eca9200
2006-06-25 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/glade-gtk.c: Make undoing increasing notebook size work properly
(needed to destroy the added tab label project widget and remove it from the
project).
* plugins/gtk+/glade-gtk.c:
- Make undoing increasing notebook size work properly (needed to destroy
the added tab label project widget and remove it from the project).
- Disable Add/Remove parent actions on GtkToolItem, GtkMenu and GtkMenuItem.
* plugins/gtk+/gtk+.xml.in: Set "label-xalign" of GtkFrame to be "save-always"
(to counter the evil effects of gtk+ bug 460272, which made it impossible to
......@@ -23,6 +24,9 @@
catalog without giving a real type, only automatically derive from a type specified
in the catalog (refit Muntyan's patch from bug 352714).
* gladeui/glade-popup.c: Fixed placeholder menu to also include actions of the
parent widget.
2006-06-24 Tristan Van Berkom <tvb@gnome.org>
* src/glade-window.c: Set custom label on the property editor sensitive/insensitive
......
......@@ -349,16 +349,33 @@ glade_popup_create_menu (GladeWidget *widget,
/* packing actions are a little different on placholders */
if (placeholder && placeholder->packing_actions)
if (placeholder)
{
GtkWidget *separator = gtk_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), separator);
gtk_widget_show (separator);
if (widget->actions)
{
GtkWidget *separator = gtk_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), separator);
gtk_widget_show (separator);
glade_popup_action_populate_menu_real (popup_menu,
placeholder->packing_actions,
G_CALLBACK (glade_popup_menuitem_ph_packing_activated),
placeholder);
glade_popup_action_populate_menu_real
(popup_menu,
widget->actions,
G_CALLBACK (glade_popup_menuitem_activated),
widget);
}
if (placeholder->packing_actions)
{
GtkWidget *separator = gtk_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), separator);
gtk_widget_show (separator);
glade_popup_action_populate_menu_real
(popup_menu,
placeholder->packing_actions,
G_CALLBACK (glade_popup_menuitem_ph_packing_activated),
placeholder);
}
}
else if (widget->actions || (packing && widget->packing_actions))
{
......
......@@ -943,7 +943,6 @@ gwa_extend_with_node_load_sym (GladeWidgetAdaptorClass *klass,
* the thing it that g_module_symbol() should use a function pointer
* instead of a gpointer!
*/
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CONSTRUCTOR_FUNCTION,
&symbol))
......
......@@ -4480,6 +4480,27 @@ glade_gtk_image_set_property (GladeWidgetAdaptor *adaptor,
id, value);
}
/* ----------------------------- GtkMenu ------------------------------ */
GObject *
glade_gtk_menu_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GladeWidgetAdaptor *adaptor;
GObject *ret_obj;
ret_obj = GWA_GET_OCLASS(GTK_TYPE_CONTAINER)->constructor
(type, n_construct_properties, construct_properties);
adaptor = GLADE_WIDGET_ADAPTOR (ret_obj);
glade_widget_adaptor_action_remove (adaptor, "add_parent");
glade_widget_adaptor_action_remove (adaptor, "remove_parent");
return ret_obj;
}
/* ----------------------------- GtkMenuShell ------------------------------ */
void
glade_gtk_menu_shell_add_child (GladeWidgetAdaptor *adaptor,
......@@ -4822,6 +4843,25 @@ glade_gtk_menu_shell_action_activate (GladeWidgetAdaptor *adaptor,
}
/* ----------------------------- GtkMenuItem(s) ------------------------------ */
GObject *
glade_gtk_menu_item_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GladeWidgetAdaptor *adaptor;
GObject *ret_obj;
ret_obj = GWA_GET_OCLASS(GTK_TYPE_CONTAINER)->constructor
(type, n_construct_properties, construct_properties);
adaptor = GLADE_WIDGET_ADAPTOR (ret_obj);
glade_widget_adaptor_action_remove (adaptor, "add_parent");
glade_widget_adaptor_action_remove (adaptor, "remove_parent");
return ret_obj;
}
GList *
glade_gtk_menu_item_get_children (GladeWidgetAdaptor *adaptor,
GObject *object)
......@@ -5637,6 +5677,25 @@ glade_gtk_toolbar_action_activate (GladeWidgetAdaptor *adaptor,
}
/* ----------------------------- GtkToolItem ------------------------------ */
GObject *
glade_gtk_tool_item_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GladeWidgetAdaptor *adaptor;
GObject *ret_obj;
ret_obj = GWA_GET_OCLASS(GTK_TYPE_CONTAINER)->constructor
(type, n_construct_properties, construct_properties);
adaptor = GLADE_WIDGET_ADAPTOR (ret_obj);
glade_widget_adaptor_action_remove (adaptor, "add_parent");
glade_widget_adaptor_action_remove (adaptor, "remove_parent");
return ret_obj;
}
void
glade_gtk_tool_item_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
......
......@@ -331,6 +331,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkMenuItem" generic-name="menuitem" _title="Menu Item" use-placeholders="False">
<constructor-function>glade_gtk_menu_item_constructor</constructor-function>
<post-create-function>glade_gtk_menu_item_post_create</post-create-function>
<get-children-function>glade_gtk_menu_item_get_children</get-children-function>
<set-property-function>glade_gtk_menu_item_set_property</set-property-function>
......@@ -485,10 +486,12 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkToolItem" generic-name="toolitem" title="GtkToolItem">
<post-create-function>glade_gtk_tool_item_post_create</post-create-function>
<constructor-function>glade_gtk_tool_item_constructor</constructor-function>
</glade-widget-class>
<glade-widget-class name="GtkSeparatorToolItem" generic-name="separatortoolitem" _title="Separator Tool Item"/>
<glade-widget-class name="GtkToolButton" generic-name="toolbutton" _title="Tool Button">
<set-property-function>glade_gtk_tool_button_set_property</set-property-function>
......@@ -1146,6 +1149,7 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkMenu" generic-name="menu" _title="Popup Menu" toplevel="True">
<!-- We do not want glade_gtk_container_post_create be executed -->
<constructor-function>glade_gtk_menu_constructor</constructor-function>
<post-create-function>empty</post-create-function>
<actions>
<action id="launch_editor" _name="Edit&#8230;" stock="gtk-edit" important="True"/>
......
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