diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-01-26 00:37:58 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-01-26 00:37:58 +0000 |
commit | 65dd58ffa32006f6d3f76a822d632796160a3d65 (patch) | |
tree | 7c1feba2b7af7b1957bc47067e03566743372023 /gtk | |
parent | d355451c516218b8ec7ff4dc439817a559252225 (diff) | |
download | gdk-pixbuf-65dd58ffa32006f6d3f76a822d632796160a3d65.tar.gz |
Queue a redraw on the tab area when a tab changes size. (Includes
Mon Jan 25 19:41:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): Queue
a redraw on the tab area when a tab changes size.
(Includes improvements from Lars Hamann)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtknotebook.c | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 2aa826499..88dd82905 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2988,6 +2988,7 @@ gtk_notebook_page_allocate (GtkNotebook *notebook, GtkNotebookPage *page, GtkAllocation *allocation) { + GtkWidget *widget; GtkAllocation child_allocation; gint xthickness; gint ythickness; @@ -2997,10 +2998,59 @@ gtk_notebook_page_allocate (GtkNotebook *notebook, g_return_if_fail (page != NULL); g_return_if_fail (allocation != NULL); - page->allocation = *allocation; + widget = GTK_WIDGET (notebook); + + xthickness = widget->style->klass->xthickness; + ythickness = widget->style->klass->ythickness; + + /* If the size of the notebook tabs change, we need to queue + * a redraw on the tab area + */ + if ((allocation->width != page->allocation.width) || + (allocation->height != page->allocation.height)) + { + gint x, y, width, height, border_width; + + border_width = GTK_CONTAINER (notebook)->border_width; + + switch (notebook->tab_pos) + { + case GTK_POS_TOP: + width = widget->allocation.width; + height = MAX (page->allocation.height, allocation->height) + + ythickness; + x = 0; + y = border_width; + break; + + case GTK_POS_BOTTOM: + width = widget->allocation.width + xthickness; + height = MAX (page->allocation.height, allocation->height) + + ythickness; + x = 0; + y = widget->allocation.height - height - border_width; + break; + + case GTK_POS_LEFT: + width = MAX (page->allocation.width, allocation->width) + xthickness; + height = widget->allocation.height; + x = border_width; + y = 0; + break; + + case GTK_POS_RIGHT: + default: /* quiet gcc */ + width = MAX (page->allocation.width, allocation->width) + xthickness; + height = widget->allocation.height; + x = widget->allocation.width - width - border_width; + y = 0; + break; + } + + gtk_widget_queue_clear_area (widget, x, y, width, height); + } - xthickness = GTK_WIDGET (notebook)->style->klass->xthickness; - ythickness = GTK_WIDGET (notebook)->style->klass->ythickness; + page->allocation = *allocation; if (notebook->cur_page != page) { |