From 9cde596b733991b1fed5853b41fbdee2b19931f5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 16 May 2005 04:54:35 +0000 Subject: [PATCH] Only shrink the label if we need to. (#169390, Felix Riemann) 2005-05-16 Matthias Clasen * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only shrink the label if we need to. (#169390, Felix Riemann) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkstatusbar.c | 15 +++++++++------ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc2c209148..ef3a59d05a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-05-16 Matthias Clasen + + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only shrink + the label if we need to. (#169390, Felix Riemann) + Sat May 14 00:07:46 2005 Manish Singh * gdk/gdkdraw.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fc2c209148..ef3a59d05a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-05-16 Matthias Clasen + + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only shrink + the label if we need to. (#169390, Felix Riemann) + Sat May 14 00:07:46 2005 Manish Singh * gdk/gdkdraw.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fc2c209148..ef3a59d05a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-05-16 Matthias Clasen + + * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only shrink + the label if we need to. (#169390, Felix Riemann) + Sat May 14 00:07:46 2005 Manish Singh * gdk/gdkdraw.c diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index 13beb6ef3b..1cac81d9ab 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -850,13 +850,16 @@ gtk_statusbar_size_allocate (GtkWidget *widget, } else { - /* shrink the label to make room for the grip */ - *allocation = statusbar->label->allocation; - allocation->width -= rect.width; - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - allocation->x += rect.width; + if (statusbar->label->allocation.width + rect.width > statusbar->frame->allocation.width) + { + /* shrink the label to make room for the grip */ + *allocation = statusbar->label->allocation; + allocation->width -= rect.width; + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + allocation->x += rect.width; - gtk_widget_size_allocate (statusbar->label, allocation); + gtk_widget_size_allocate (statusbar->label, allocation); + } } } }