]> Pileus Git - ~andy/gtk/commitdiff
don't add extra width or height if the requested size is mandatory (i.e.
authorTim Janik <timj@gtk.org>
Thu, 25 Feb 1999 08:58:23 +0000 (08:58 +0000)
committerTim Janik <timj@src.gnome.org>
Thu, 25 Feb 1999 08:58:23 +0000 (08:58 +0000)
Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
        extra width or height if the requested size is mandatory (i.e. set
        through child->usize).

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/gtkscrolledwindow.c

index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index 203836ffc80361b65ef00fb5420f887f1e8ca497..36039abf692a0a1e26df3cb7870f8c1d2bed6bb3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 09:50:38 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): don't add
+       extra width or height if the requested size is mandatory (i.e. set
+       through child->usize).
+
 Thu Feb 25 02:13:20 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/gtkmenu.[ch]: New function gtk_menu_reorder_child()
index dc4b4ff35c0e09228b128e0e0fe8f87cf90349a5..f230be53f976605ea60defc48f524d6f046c0db0 100644 (file)
@@ -587,8 +587,8 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
 {
   GtkScrolledWindow *scrolled_window;
   GtkBin *bin;
-  gint extra_height;
   gint extra_width;
+  gint extra_height;
   GtkRequisition hscrollbar_requisition;
   GtkRequisition vscrollbar_requisition;
   GtkRequisition child_requisition;
@@ -600,6 +600,8 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
   scrolled_window = GTK_SCROLLED_WINDOW (widget);
   bin = GTK_BIN (scrolled_window);
 
+  extra_width = 0;
+  extra_height = 0;
   requisition->width = 0;
   requisition->height = 0;
   
@@ -625,7 +627,10 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
 
          aux_info = gtk_object_get_data_by_id (GTK_OBJECT (bin->child), quark_aux_info);
          if (aux_info && aux_info->width > 0)
-           requisition->width += aux_info->width;
+           {
+             requisition->width += aux_info->width;
+             extra_width = -1;
+           }
          else
            requisition->width += vscrollbar_requisition.width;
        }
@@ -638,31 +643,33 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
 
          aux_info = gtk_object_get_data_by_id (GTK_OBJECT (bin->child), quark_aux_info);
          if (aux_info && aux_info->height > 0)
-           requisition->height += aux_info->height;
+           {
+             requisition->height += aux_info->height;
+             extra_height = -1;
+           }
          else
            requisition->height += hscrollbar_requisition.height;
        }
     }
 
-  extra_width = 0;
-  extra_height = 0;
-
   if ((scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC) ||
       GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
     {
       requisition->width = MAX (requisition->width, hscrollbar_requisition.width);
-      extra_height = SCROLLBAR_SPACING (scrolled_window) + hscrollbar_requisition.height;
+      if (!extra_height)
+       extra_height = SCROLLBAR_SPACING (scrolled_window) + hscrollbar_requisition.height;
     }
 
   if ((scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC) ||
       GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
     {
       requisition->height = MAX (requisition->height, vscrollbar_requisition.height);
-      extra_width = SCROLLBAR_SPACING (scrolled_window) + vscrollbar_requisition.width;
+      if (!extra_width)
+       extra_width = SCROLLBAR_SPACING (scrolled_window) + vscrollbar_requisition.width;
     }
 
-  requisition->width += GTK_CONTAINER (widget)->border_width * 2 + extra_width;
-  requisition->height += GTK_CONTAINER (widget)->border_width * 2 + extra_height;
+  requisition->width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
+  requisition->height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
 }
 
 static void