diff options
author | Owen Taylor <otaylor@redhat.com> | 1998-12-15 17:56:31 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-12-15 17:56:31 +0000 |
commit | cceabe57ba5f083b9f7ffc276050bf3634cc7af4 (patch) | |
tree | 252c4465bf0b3875fc3ffae3cfa08d40da8ea5cc /gtk/gtkvpaned.c | |
parent | 1bf27c357d69d4a23eaccdb9aeab168f49e98cd7 (diff) | |
download | gdk-pixbuf-cceabe57ba5f083b9f7ffc276050bf3634cc7af4.tar.gz |
Fixed up some warnings.
Tue Dec 15 11:37:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Fixed up some warnings.
Tue Dec 15 10:32:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{h,v,}paned.{c,h}: Add new functions
gtk_paned_set_position(),
gtk_paned_pack1/2(). The latter take a
shrink and resize parameters, that allows setting
minimum sizes and getting 'relative' resizing.
Diffstat (limited to 'gtk/gtkvpaned.c')
-rw-r--r-- | gtk/gtkvpaned.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/gtk/gtkvpaned.c b/gtk/gtkvpaned.c index 3fb5a1a2e..ed52a76bc 100644 --- a/gtk/gtkvpaned.c +++ b/gtk/gtkvpaned.c @@ -144,17 +144,12 @@ gtk_vpaned_size_allocate (GtkWidget *widget, paned = GTK_PANED (widget); border_width = GTK_CONTAINER (widget)->border_width; - if (!paned->position_set) - { - if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1)) - paned->child1_size = paned->child1->requisition.height; - else - paned->child1_size = 0; - } - else - paned->child1_size = CLAMP (paned->child1_size, 0, - allocation->height - paned->gutter_size - - 2 * GTK_CONTAINER (paned)->border_width); + gtk_paned_compute_position (paned, + widget->allocation.height + - paned->gutter_size + - 2 * border_width, + paned->child1->requisition.height, + paned->child2->requisition.height); /* Move the handle before the children so we don't get extra expose events */ @@ -347,12 +342,12 @@ gtk_vpaned_motion (GtkWidget *widget, GdkEventMotion *event) if (paned->in_drag) { + gint size = y - GTK_CONTAINER (paned)->border_width - paned->gutter_size/2; + gtk_vpaned_xor_line (paned); - paned->child1_size = y - GTK_CONTAINER (paned)->border_width - - paned->gutter_size/2; - paned->child1_size = CLAMP (paned->child1_size, 0, - widget->allocation.height - paned->gutter_size - - 2 * GTK_CONTAINER (paned)->border_width); + paned->child1_size = CLAMP (size, + paned->min_position, + paned->max_position); gtk_vpaned_xor_line (paned); } |