From 7814007d3b3728fa0b91acdf28bae25e16f5c8a3 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Wed, 9 Aug 2006 09:03:30 +0000 Subject: Fix for bug #348565 svn path=/trunk/; revision=32507 --- mail/em-format-html-display.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mail/em-format-html-display.c') diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index cb184e8692..6dbaa0a96c 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -2216,8 +2216,10 @@ efhd_bar_resize(GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) gtk_widget_size_request (efhd->priv->attachment_bar, &req); width = ((GtkWidget *) efh->html)->allocation.width - 16; - /* Update the width of the bar */ - e_attachment_bar_set_width(E_ATTACHMENT_BAR(efhd->priv->attachment_bar), width); + + /* Update the width of the bar when the width is greater than 1*/ + if (width > 0) + e_attachment_bar_set_width(E_ATTACHMENT_BAR(efhd->priv->attachment_bar), width); } static gboolean @@ -2247,7 +2249,7 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh; struct _EMFormatHTMLDisplayPrivate *priv = efhd->priv; GtkWidget *hbox1, *hbox2, *hbox3, *vbox, *txt, *image, *save, *scroll; - int width, height; + int width, height, bar_width; priv->attachment_bar = e_attachment_bar_new(NULL); scroll = gtk_scrolled_window_new (NULL, NULL); @@ -2288,9 +2290,10 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec /* FIXME: What if the text is more?. Should we reduce the text with appending ...? * or resize the bar? How to figure out that, it needs more space? */ + bar_width = ((GtkWidget *)efh->html)->parent->allocation.width - /* FIXME */16; gtk_widget_set_size_request (priv->attachment_bar, - ((GtkWidget *)efh->html)->parent->allocation.width - /* FIXME */16, - 84 /* FIXME: Default show only one row, Dont hardcode size*/); + bar_width > 0 ? bar_width : 0, + 84 /* FIXME: Default show only one row, Dont hardcode size*/); vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)vbox, hbox2, FALSE, FALSE, 2); -- cgit v1.2.3