diff --git a/ChangeLog b/ChangeLog index 4273c223ff..e03e3c25d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Dec 19 21:52:46 2003 Kristian Rietveld + + * gtk/gtkmenu.c (gtk_menu_do_insert): move item insertion logic + here from gtk_menu_real_insert(), + (gtk_menu_real_insert): just call gtk_menu_do_insert(), + (gtk_menu_reorder_child): run _do_insert after inserting the child + (unbreaks _reorder_child, reported by Tim Janik). + 2003-12-19 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4273c223ff..e03e3c25d5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Fri Dec 19 21:52:46 2003 Kristian Rietveld + + * gtk/gtkmenu.c (gtk_menu_do_insert): move item insertion logic + here from gtk_menu_real_insert(), + (gtk_menu_real_insert): just call gtk_menu_do_insert(), + (gtk_menu_reorder_child): run _do_insert after inserting the child + (unbreaks _reorder_child, reported by Tim Janik). + 2003-12-19 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4273c223ff..e03e3c25d5 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Fri Dec 19 21:52:46 2003 Kristian Rietveld + + * gtk/gtkmenu.c (gtk_menu_do_insert): move item insertion logic + here from gtk_menu_real_insert(), + (gtk_menu_real_insert): just call gtk_menu_do_insert(), + (gtk_menu_reorder_child): run _do_insert after inserting the child + (unbreaks _reorder_child, reported by Tim Janik). + 2003-12-19 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4273c223ff..e03e3c25d5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Fri Dec 19 21:52:46 2003 Kristian Rietveld + + * gtk/gtkmenu.c (gtk_menu_do_insert): move item insertion logic + here from gtk_menu_real_insert(), + (gtk_menu_real_insert): just call gtk_menu_do_insert(), + (gtk_menu_reorder_child): run _do_insert after inserting the child + (unbreaks _reorder_child, reported by Tim Janik). + 2003-12-19 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4273c223ff..e03e3c25d5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Fri Dec 19 21:52:46 2003 Kristian Rietveld + + * gtk/gtkmenu.c (gtk_menu_do_insert): move item insertion logic + here from gtk_menu_real_insert(), + (gtk_menu_real_insert): just call gtk_menu_do_insert(), + (gtk_menu_reorder_child): run _do_insert after inserting the child + (unbreaks _reorder_child, reported by Tim Janik). + 2003-12-19 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 25bf3e6500..34bc4b20e5 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -172,6 +172,9 @@ static void gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell, GtkWidget *menu_item); static void gtk_menu_select_item (GtkMenuShell *menu_shell, GtkWidget *menu_item); +static void gtk_menu_do_insert (GtkMenuShell *menu_shell, + GtkWidget *child, + gint position); static void gtk_menu_real_insert (GtkMenuShell *menu_shell, GtkWidget *child, gint position); @@ -964,19 +967,14 @@ gtk_menu_new (void) } static void -gtk_menu_real_insert (GtkMenuShell *menu_shell, - GtkWidget *child, - gint position) +gtk_menu_do_insert (GtkMenuShell *menu_shell, + GtkWidget *child, + gint position) { gint i; GList *children; GtkMenuPrivate *priv; - if (GTK_WIDGET_REALIZED (menu_shell)) - gtk_widget_set_parent_window (child, GTK_MENU (menu_shell)->bin_window); - - GTK_MENU_SHELL_CLASS (parent_class)->insert (menu_shell, child, position); - priv = gtk_menu_get_private (GTK_MENU (menu_shell)); if (position < 0) @@ -1015,6 +1013,19 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell, position, position + 1); } +static void +gtk_menu_real_insert (GtkMenuShell *menu_shell, + GtkWidget *child, + gint position) +{ + if (GTK_WIDGET_REALIZED (menu_shell)) + gtk_widget_set_parent_window (child, GTK_MENU (menu_shell)->bin_window); + + GTK_MENU_SHELL_CLASS (parent_class)->insert (menu_shell, child, position); + + gtk_menu_do_insert (menu_shell, child, position); +} + static void gtk_menu_tearoff_bg_copy (GtkMenu *menu) { @@ -1772,13 +1783,18 @@ gtk_menu_reorder_child (GtkMenu *menu, gint position) { GtkMenuShell *menu_shell; + g_return_if_fail (GTK_IS_MENU (menu)); g_return_if_fail (GTK_IS_MENU_ITEM (child)); + menu_shell = GTK_MENU_SHELL (menu); + if (g_list_find (menu_shell->children, child)) { menu_shell->children = g_list_remove (menu_shell->children, child); - menu_shell->children = g_list_insert (menu_shell->children, child, position); + menu_shell->children = g_list_insert (menu_shell->children, child, position); + gtk_menu_do_insert (menu_shell, child, position); + if (GTK_WIDGET_VISIBLE (menu_shell)) gtk_widget_queue_resize (GTK_WIDGET (menu_shell)); }