Make this work when the slider buttons have been destroyed.

2004-03-17  Morten Welinder  <terra@gnome.org>

	* 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
This commit is contained in:
Morten Welinder 2004-03-17 15:29:06 +00:00 committed by Morten Welinder
parent 1077e7f904
commit feba65f266
6 changed files with 96 additions and 12 deletions

View File

@ -1,3 +1,16 @@
2004-03-17 Morten Welinder <terra@gnome.org>
* 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 <terra@gnome.org>
* 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 <maclas@gmx.de>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):

View File

@ -1,3 +1,16 @@
2004-03-17 Morten Welinder <terra@gnome.org>
* 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 <terra@gnome.org>
* 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 <maclas@gmx.de>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):

View File

@ -1,3 +1,16 @@
2004-03-17 Morten Welinder <terra@gnome.org>
* 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 <terra@gnome.org>
* 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 <maclas@gmx.de>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):

View File

@ -1,3 +1,16 @@
2004-03-17 Morten Welinder <terra@gnome.org>
* 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 <terra@gnome.org>
* 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 <maclas@gmx.de>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):

View File

@ -1,3 +1,16 @@
2004-03-17 Morten Welinder <terra@gnome.org>
* 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 <terra@gnome.org>
* 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 <maclas@gmx.de>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):

View File

@ -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