diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-01-18 01:18:05 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-01-18 01:18:05 +0000 |
commit | a8e2fc30823239e26f08cc5303899c56ca351296 (patch) | |
tree | 5170301f8f0f3e772f557f958b16ad131be85fe3 /gtk/gtknotebook.c | |
parent | c6a3df04741ca1849475d576e6e5b95ddd83c86f (diff) | |
download | gdk-pixbuf-a8e2fc30823239e26f08cc5303899c56ca351296.tar.gz |
Fix missing allocation.x/y offsets. (#68962, Jacob Berkman)
Thu Jan 17 20:13:14 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix
missing allocation.x/y offsets. (#68962, Jacob
Berkman)
* gtk/gtknotebook.c (gtk_notebook_size_allocate):
Queue a redraw on the entire widget if we hide
the last page or show the first. (Also #68962)
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r-- | gtk/gtknotebook.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 438adf8cf..d1f725d29 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1158,6 +1158,7 @@ gtk_notebook_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkNotebook *notebook = GTK_NOTEBOOK (widget); + gint vis_pages = 0; widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) @@ -1220,11 +1221,21 @@ gtk_notebook_size_allocate (GtkWidget *widget, children = children->next; if (GTK_WIDGET_VISIBLE (page->child)) - gtk_widget_size_allocate (page->child, &child_allocation); + { + gtk_widget_size_allocate (page->child, &child_allocation); + vis_pages++; + } } gtk_notebook_pages_allocate (notebook); } + + if ((vis_pages != 0) != notebook->have_visible_child) + { + notebook->have_visible_child = (vis_pages != 0); + if (notebook->show_tabs) + gtk_widget_queue_draw (widget); + } } static gint @@ -2119,6 +2130,9 @@ gtk_notebook_redraw_tabs (GtkNotebook *notebook) break; } + redraw_rect.x += widget->allocation.x; + redraw_rect.y += widget->allocation.y; + gdk_window_invalidate_rect (widget->window, &redraw_rect, TRUE); } |