[gtk+/native-layout] Restore functionality where ellipsizing label *minimum* size grows to "max-char-width".



commit e8a365ce36da1e61225520dc313b654fe49c7dd9
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sat Apr 17 23:06:24 2010 -0400

    Restore functionality where ellipsizing label *minimum* size grows to "max-char-width".

 gtk/gtklabel.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 07546a3..911b790 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2994,6 +2994,15 @@ get_label_char_width (GtkLabel *label,
 	  gint max_char_width = char_pixels * priv->max_width_chars;
 	  gint max_width      = MIN (text_width, max_char_width);
 
+	  /* With max-char-width specified, we let the minimum widths of 
+	   * ellipsized text crawl up to the max-char-width
+	   * (note that we dont want to limit the minimum width for wrapping text).
+	   */
+	  if (label->ellipsize)
+	    {
+	      *minimum = MIN (text_width, max_width);
+	    }
+
 	  *natural = MAX (rect.width, max_width);
 	}
    }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]