From a2813e1772a3b222a0bae66af6df5ddf8ae434b3 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 7 Oct 2002 22:33:43 +0000 Subject: Allow the slider to be set all the way to the edge, and if that happens, Mon Oct 7 18:21:39 2002 Owen Taylor * gtk/gtk[hv]paned.c gtk/gtkpaned.c: Allow the slider to be set all the way to the edge, and if that happens, use gtk_widget_set_child_visible() to hide the appropriate child. (#72784, request from Darin Adler) --- gtk/gtkhpaned.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gtk/gtkhpaned.c') diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c index 4d35345a5b..27eb316e07 100644 --- a/gtk/gtkhpaned.c +++ b/gtk/gtkhpaned.c @@ -182,13 +182,13 @@ gtk_hpaned_size_allocate (GtkWidget *widget, } child1_allocation.height = child2_allocation.height = MAX (1, (gint) allocation->height - border_width * 2); - child1_allocation.width = paned->child1_size; + child1_allocation.width = MAX (1, paned->child1_size); child1_allocation.x = widget->allocation.x + border_width; child1_allocation.y = child2_allocation.y = widget->allocation.y + border_width; - child2_allocation.x = child1_allocation.x + child1_allocation.width + paned->handle_pos.width; + child2_allocation.x = child1_allocation.x + paned->child1_size + paned->handle_pos.width; child2_allocation.width = MAX (1, widget->allocation.x + widget->allocation.width - child2_allocation.x - border_width); - + /* Now allocate the childen, making sure, when resizing not to * overlap the windows */ @@ -211,6 +211,9 @@ gtk_hpaned_size_allocate (GtkWidget *widget, if (GTK_WIDGET_REALIZED (widget)) gdk_window_hide (paned->handle); + gtk_widget_set_child_visible (paned->child1, TRUE); + gtk_widget_set_child_visible (paned->child2, TRUE); + child_allocation.x = widget->allocation.x + border_width; child_allocation.y = widget->allocation.y + border_width; child_allocation.width = MAX (1, allocation->width - 2 * border_width); -- cgit v1.2.1