]> Pileus Git - ~andy/gtk/commitdiff
Be a bit more careful to not shrink the label to a negative width.
authorMatthias Clasen <mclasen@redhat.com>
Thu, 21 Jul 2005 19:10:48 +0000 (19:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 21 Jul 2005 19:10:48 +0000 (19:10 +0000)
2005-07-21  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Be
a bit more careful to not shrink the label to a negative
width.  (#311175, Thomas Vander Stichele)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkstatusbar.c

index 05dab0320883670e864ba4798b37b1f7fae053d1..5398293b10c5b56168bbbe769d8eed1c7d81f258 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-07-21  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Be
+       a bit more careful to not shrink the label to a negative
+       width.  (#311175, Thomas Vander Stichele)
+
        * gtk/gtk.symbols: mark gtk_socket_steal as deprecated.
 
        * configure.in: Bump the cairo requirement.
index 05dab0320883670e864ba4798b37b1f7fae053d1..5398293b10c5b56168bbbe769d8eed1c7d81f258 100644 (file)
@@ -1,5 +1,9 @@
 2005-07-21  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Be
+       a bit more careful to not shrink the label to a negative
+       width.  (#311175, Thomas Vander Stichele)
+
        * gtk/gtk.symbols: mark gtk_socket_steal as deprecated.
 
        * configure.in: Bump the cairo requirement.
index 05dab0320883670e864ba4798b37b1f7fae053d1..5398293b10c5b56168bbbe769d8eed1c7d81f258 100644 (file)
@@ -1,5 +1,9 @@
 2005-07-21  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Be
+       a bit more careful to not shrink the label to a negative
+       width.  (#311175, Thomas Vander Stichele)
+
        * gtk/gtk.symbols: mark gtk_socket_steal as deprecated.
 
        * configure.in: Bump the cairo requirement.
index 1cac81d9ab284b70eaa8b3e73dbc3886d7541b55..8f4eb93a8337c68e99790037e70fe0a3934dadd9 100644 (file)
@@ -751,8 +751,8 @@ gtk_statusbar_expose_event (GtkWidget      *widget,
 }
 
 static void
-gtk_statusbar_size_request   (GtkWidget      *widget,
-                              GtkRequisition *requisition)
+gtk_statusbar_size_request (GtkWidget      *widget,
+                           GtkRequisition *requisition)
 {
   GtkStatusbar *statusbar;
   GtkShadowType shadow_type;
@@ -826,7 +826,7 @@ gtk_statusbar_size_allocate  (GtkWidget     *widget,
            allocation->x += rect.width;
        }
     }
-      
+
   /* chain up normally */
   GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
@@ -854,10 +854,10 @@ gtk_statusbar_size_allocate  (GtkWidget     *widget,
            {
              /* shrink the label to make room for the grip */
              *allocation = statusbar->label->allocation;
-             allocation->width -= rect.width;
+             allocation->width = MAX (1, allocation->width - rect.width);
              if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) 
-               allocation->x += rect.width;
-         
+               allocation->x += statusbar->label->allocation.width - allocation->width;
+
              gtk_widget_size_allocate (statusbar->label, allocation);
            }
        }