diff options
author | Owen Taylor <owt1@cornell.edu> | 1998-02-17 05:07:51 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-02-17 05:07:51 +0000 |
commit | 9f96d18eb10997961838bfd81462037aadbe4447 (patch) | |
tree | f5f2a462317cd36a84a424e4b4111b82784c3d68 /gtk/gtkhpaned.c | |
parent | 7b399a225cb812578af3db269c186885840282e3 (diff) | |
download | gdk-pixbuf-9f96d18eb10997961838bfd81462037aadbe4447.tar.gz |
From Patrice Fortier <Patrice.Fortier@aquarel.fr>
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
From Patrice Fortier <Patrice.Fortier@aquarel.fr>
Add a widget->window for paned windows, so they
can be reparented properly.
Diffstat (limited to 'gtk/gtkhpaned.c')
-rw-r--r-- | gtk/gtkhpaned.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c index bf132e992..d89e00827 100644 --- a/gtk/gtkhpaned.c +++ b/gtk/gtkhpaned.c @@ -150,15 +150,18 @@ gtk_hpaned_size_allocate (GtkWidget *widget, paned->child1_size = 0; } - /* Move the handle first so we don't get extra expose events */ + /* Move the handle before the children so we don't get extra expose events */ - paned->handle_xpos = allocation->x + paned->child1_size + border_width + paned->gutter_size / 2 - paned->handle_size / 2; - paned->handle_ypos = allocation->y + allocation->height - border_width - 2*paned->handle_size; + paned->handle_xpos = paned->child1_size + border_width + paned->gutter_size / 2 - paned->handle_size / 2; + paned->handle_ypos = allocation->height - border_width - 2*paned->handle_size; if (GTK_WIDGET_REALIZED (widget)) { + gdk_window_move_resize (widget->window, + allocation->x, allocation->y, + allocation->width, allocation->height); + gdk_window_move (paned->handle, paned->handle_xpos, paned->handle_ypos); - gdk_window_raise (paned->handle); } if (GTK_WIDGET_MAPPED (widget)) @@ -172,17 +175,17 @@ gtk_hpaned_size_allocate (GtkWidget *widget, child1_allocation.height = child2_allocation.height = allocation->height - border_width * 2; child1_allocation.width = paned->child1_size; - child1_allocation.x = allocation->x + border_width; - child1_allocation.y = child2_allocation.y = allocation->y + border_width; + child1_allocation.x = border_width; + child1_allocation.y = child2_allocation.y = border_width; paned->groove_rectangle.x = child1_allocation.x + child1_allocation.width + paned->gutter_size / 2 - 1; - paned->groove_rectangle.y = allocation->y; + paned->groove_rectangle.y = 0; paned->groove_rectangle.width = 2; paned->groove_rectangle.height = allocation->height; child2_allocation.x = paned->groove_rectangle.x + paned->gutter_size / 2 + 1; - child2_allocation.width = allocation->x + allocation->width + child2_allocation.width = allocation->width - child2_allocation.x - border_width; /* Now allocate the childen, making sure, when resizing not to @@ -229,16 +232,16 @@ gtk_hpaned_draw (GtkWidget *widget, gdk_draw_line (widget->window, widget->style->dark_gc[widget->state], - widget->allocation.x + border_width + paned->child1_size + paned->gutter_size / 2 - 1, - widget->allocation.y, - widget->allocation.x + border_width + paned->child1_size + paned->gutter_size / 2 - 1, - widget->allocation.y + widget->allocation.height - 1); + border_width + paned->child1_size + paned->gutter_size / 2 - 1, + 0, + border_width + paned->child1_size + paned->gutter_size / 2 - 1, + widget->allocation.height - 1); gdk_draw_line (widget->window, widget->style->light_gc[widget->state], - widget->allocation.x + border_width + paned->child1_size + paned->gutter_size / 2, - widget->allocation.y, - widget->allocation.x + border_width + paned->child1_size + paned->gutter_size / 2, - widget->allocation.y + widget->allocation.height - 1); + border_width + paned->child1_size + paned->gutter_size / 2, + 0, + border_width + paned->child1_size + paned->gutter_size / 2, + widget->allocation.height - 1); } } @@ -263,14 +266,14 @@ gtk_hpaned_xor_line (GtkPaned *paned) GDK_GC_SUBWINDOW); } - xpos = widget->allocation.x + paned->child1_size + xpos = paned->child1_size + GTK_CONTAINER(paned)->border_width + paned->gutter_size / 2; gdk_draw_line (widget->window, paned->xor_gc, xpos, - widget->allocation.y, + 0, xpos, - widget->allocation.y + widget->allocation.height - 1); + widget->allocation.height - 1); } static gint |