diff --git a/ChangeLog b/ChangeLog index b31a6ee6e6..7dcb74831c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-03-17 Morten Welinder + + * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the + slider buttons have been destroyed. + (gtk_path_bar_remove): Make this work for slider buttons too. + Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257 + +2004-03-15 Morten Welinder + + * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path): + Sanitize and plug leak. + (check_icon_theme): Only do something if the widget has a screen. + Wed Mar 17 01:20:28 2004 Matthias Clasen * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b31a6ee6e6..7dcb74831c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +2004-03-17 Morten Welinder + + * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the + slider buttons have been destroyed. + (gtk_path_bar_remove): Make this work for slider buttons too. + Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257 + +2004-03-15 Morten Welinder + + * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path): + Sanitize and plug leak. + (check_icon_theme): Only do something if the widget has a screen. + Wed Mar 17 01:20:28 2004 Matthias Clasen * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b31a6ee6e6..7dcb74831c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +2004-03-17 Morten Welinder + + * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the + slider buttons have been destroyed. + (gtk_path_bar_remove): Make this work for slider buttons too. + Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257 + +2004-03-15 Morten Welinder + + * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path): + Sanitize and plug leak. + (check_icon_theme): Only do something if the widget has a screen. + Wed Mar 17 01:20:28 2004 Matthias Clasen * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b31a6ee6e6..7dcb74831c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +2004-03-17 Morten Welinder + + * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the + slider buttons have been destroyed. + (gtk_path_bar_remove): Make this work for slider buttons too. + Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257 + +2004-03-15 Morten Welinder + + * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path): + Sanitize and plug leak. + (check_icon_theme): Only do something if the widget has a screen. + Wed Mar 17 01:20:28 2004 Matthias Clasen * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b31a6ee6e6..7dcb74831c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +2004-03-17 Morten Welinder + + * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the + slider buttons have been destroyed. + (gtk_path_bar_remove): Make this work for slider buttons too. + Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257 + +2004-03-15 Morten Welinder + + * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path): + Sanitize and plug leak. + (check_icon_theme): Only do something if the widget has a screen. + Wed Mar 17 01:20:28 2004 Matthias Clasen * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 0f1aab9eac..3009ed7f43 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -496,6 +496,16 @@ gtk_path_bar_add (GtkContainer *container, gtk_widget_set_parent (widget, GTK_WIDGET (container)); } +static void +gtk_path_bar_remove_1 (GtkContainer *container, + GtkWidget *widget) +{ + gboolean was_visible = GTK_WIDGET_VISIBLE (widget); + gtk_widget_unparent (widget); + if (was_visible) + gtk_widget_queue_resize (GTK_WIDGET (container)); +} + static void gtk_path_bar_remove (GtkContainer *container, GtkWidget *widget) @@ -505,23 +515,29 @@ gtk_path_bar_remove (GtkContainer *container, path_bar = GTK_PATH_BAR (container); - children = path_bar->button_list; + if (widget == path_bar->up_slider_button) + { + gtk_path_bar_remove_1 (container, widget); + path_bar->up_slider_button = NULL; + return; + } + if (widget == path_bar->down_slider_button) + { + gtk_path_bar_remove_1 (container, widget); + path_bar->down_slider_button = NULL; + return; + } + + children = path_bar->button_list; while (children) { if (widget == BUTTON_DATA (children->data)->button) { - gboolean was_visible; - - was_visible = GTK_WIDGET_VISIBLE (widget); - gtk_widget_unparent (widget); - + gtk_path_bar_remove_1 (container, widget); path_bar->button_list = g_list_remove_link (path_bar->button_list, children); g_list_free (children); - - if (was_visible) - gtk_widget_queue_resize (GTK_WIDGET (container)); - break; + return; } children = children->next; @@ -550,8 +566,11 @@ gtk_path_bar_forall (GtkContainer *container, (* callback) (child, callback_data); } - (* callback) (path_bar->up_slider_button, callback_data); - (* callback) (path_bar->down_slider_button, callback_data); + if (path_bar->up_slider_button) + (* callback) (path_bar->up_slider_button, callback_data); + + if (path_bar->down_slider_button) + (* callback) (path_bar->down_slider_button, callback_data); } static void