diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-07-21 19:10:48 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-07-21 19:10:48 +0000 |
commit | cd5028315afd0c9071e7a0f55f86417aa045afa2 (patch) | |
tree | cb1d832ad2409d3ec2d2eb469bee7a565532a0ed /gtk/gtkstatusbar.c | |
parent | 5bf952292bc66ef62cd5a6cbefed939047dd3f70 (diff) | |
download | gtk+-cd5028315afd0c9071e7a0f55f86417aa045afa2.tar.gz |
Be a bit more careful to not shrink the label to a negative width.
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)
Diffstat (limited to 'gtk/gtkstatusbar.c')
-rw-r--r-- | gtk/gtkstatusbar.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index 1cac81d9ab..8f4eb93a83 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -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); } } |