diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkhpaned.c | 9 | ||||
-rw-r--r-- | gtk/gtkpaned.c | 5 | ||||
-rw-r--r-- | gtk/gtkvpaned.c | 7 |
3 files changed, 15 insertions, 6 deletions
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); diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index cb078fb3ed..325128e81c 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -922,7 +922,7 @@ gtk_paned_compute_position (GtkPaned *paned, if (!paned->position_set) { if (paned->child1_resize && !paned->child2_resize) - paned->child1_size = MAX (1, allocation - child2_req); + paned->child1_size = MAX (0, allocation - child2_req); else if (!paned->child1_resize && paned->child2_resize) paned->child1_size = child1_req; else if (child1_req + child2_req != 0) @@ -948,6 +948,9 @@ gtk_paned_compute_position (GtkPaned *paned, paned->min_position, paned->max_position); + gtk_widget_set_child_visible (paned->child1, paned->child1_size != 0); + gtk_widget_set_child_visible (paned->child2, paned->child1_size != allocation); + if (paned->child1_size != old_position) g_object_notify (G_OBJECT (paned), "position"); diff --git a/gtk/gtkvpaned.c b/gtk/gtkvpaned.c index 47d12ddc2f..9024e64494 100644 --- a/gtk/gtkvpaned.c +++ b/gtk/gtkvpaned.c @@ -182,11 +182,11 @@ gtk_vpaned_size_allocate (GtkWidget *widget, } child1_allocation.width = child2_allocation.width = MAX (1, (gint) allocation->width - border_width * 2); - child1_allocation.height = paned->child1_size; + child1_allocation.height = MAX (1, paned->child1_size); child1_allocation.x = child2_allocation.x = widget->allocation.x + border_width; child1_allocation.y = widget->allocation.y + border_width; - child2_allocation.y = child1_allocation.y + child1_allocation.height + paned->handle_pos.height; + child2_allocation.y = child1_allocation.y + paned->child1_size + paned->handle_pos.height; child2_allocation.height = MAX (1, widget->allocation.y + widget->allocation.height - child2_allocation.y - border_width); /* Now allocate the childen, making sure, when resizing not to @@ -211,6 +211,9 @@ gtk_vpaned_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); |