Commit 8c6dea6f authored by Tristan Van Berkom's avatar Tristan Van Berkom

Added parent options in placeholder context menus.


	* gladeui/glade-popup.c: Added parent options in placeholder context menus.


svn path=/trunk/; revision=1501
parent 174a98bd
......@@ -4,6 +4,8 @@
debugging property values in plugins: glade_widget_property_string(),
glade_widget_pack_property_string().
* gladeui/glade-popup.c: Added parent options in placeholder context menus.
* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Reset label/markup/use-underline
properties at realize time, this fixes load time glitches with markup
and mnemonics (bug 396446).
......
......@@ -319,7 +319,9 @@ glade_popup_action_populate_menu (GtkWidget *menu,
}
static GtkWidget *
glade_popup_create_menu (GladeWidget *widget, gboolean packing)
glade_popup_create_menu (GladeWidget *widget,
GladePlaceholder *placeholder,
gboolean packing)
{
GtkWidget *popup_menu;
gboolean sensitive;
......@@ -333,53 +335,43 @@ glade_popup_create_menu (GladeWidget *widget, gboolean packing)
glade_popup_append_item (popup_menu, GTK_STOCK_COPY, NULL, TRUE,
glade_popup_copy_cb, widget);
/* paste is placholder specific when the popup is on a placeholder */
sensitive = glade_clipboard_get_has_selection (glade_app_get_clipboard ());
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, sensitive,
glade_popup_paste_cb, widget);
if (placeholder)
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, sensitive,
glade_popup_placeholder_paste_cb, placeholder);
else
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, sensitive,
glade_popup_paste_cb, widget);
glade_popup_append_item (popup_menu, GTK_STOCK_DELETE, NULL, TRUE,
glade_popup_delete_cb, widget);
if (widget->actions || (packing && widget->packing_actions))
/* packing actions are a little different on placholders */
if (placeholder && 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 (popup_menu, widget, NULL, packing);
glade_popup_action_populate_menu_real (popup_menu,
placeholder->packing_actions,
G_CALLBACK (glade_popup_menuitem_ph_packing_activated),
placeholder);
}
return popup_menu;
}
static GtkWidget *
glade_popup_create_placeholder_menu (GladePlaceholder *placeholder)
{
GtkWidget *popup_menu;
gboolean sensitive;
popup_menu = gtk_menu_new ();
sensitive = glade_clipboard_get_has_selection (glade_app_get_clipboard ());
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE, NULL, sensitive,
glade_popup_placeholder_paste_cb, placeholder);
if (placeholder->packing_actions)
else if (widget->actions || (packing && widget->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);
glade_popup_action_populate_menu (popup_menu, widget, NULL, packing);
}
return popup_menu;
}
static GtkWidget *
glade_popup_create_clipboard_menu (GladeWidget *widget)
{
......@@ -411,7 +403,7 @@ glade_popup_widget_pop (GladeWidget *widget,
g_return_if_fail (GLADE_IS_WIDGET (widget));
popup_menu = glade_popup_create_menu (widget, packing);
popup_menu = glade_popup_create_menu (widget, NULL, packing);
if (event)
{
......@@ -431,13 +423,16 @@ void
glade_popup_placeholder_pop (GladePlaceholder *placeholder,
GdkEventButton *event)
{
GladeWidget *widget;
GtkWidget *popup_menu;
gint button;
gint event_time;
g_return_if_fail (GLADE_IS_PLACEHOLDER (placeholder));
popup_menu = glade_popup_create_placeholder_menu (placeholder);
widget = glade_placeholder_get_parent (placeholder);
popup_menu = glade_popup_create_menu (widget, placeholder, TRUE);
if (event)
{
......
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