]> Pileus Git - ~andy/gtk/commitdiff
Fix missing allocation.x/y offsets. (#68962, Jacob Berkman)
authorOwen Taylor <otaylor@redhat.com>
Fri, 18 Jan 2002 01:18:05 +0000 (01:18 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 18 Jan 2002 01:18:05 +0000 (01:18 +0000)
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)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtknotebook.c

index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 0cda76c973a988fb95e70c20072f55f8090fc55e..3c36169aa59750ab58384b9676e2d08d465aac0e 100644 (file)
@@ -1,3 +1,13 @@
+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)
+       
 2002-01-17  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
index 438adf8cf247931b7927fe0fb8e53df61f1e496c..d1f725d2930255c8cc38c438524313a62d2256d5 100644 (file)
@@ -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);
 }