[gnumeric] Correctly size the autoexpressions. [#625521]



commit 91248e29beff46bf2182f03aee8229ecc1e8a646
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Wed Jul 28 17:05:11 2010 -0600

    Correctly size the autoexpressions. [#625521]
    
    2010-07-28  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/wbc-gtk.c (wbc_gtk_create_status_area): size the autoexpr label to contain
    	  about 25 typical characters and ellipsize it on the left
    	* src/workbook-view.c (wb_view_auto_expr_recalc): format teh autoexpression to an
    	  appropriate length

 ChangeLog           |    7 +++++++
 NEWS                |    1 +
 src/wbc-gtk.c       |    3 ++-
 src/workbook-view.c |    5 ++++-
 4 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7427038..3d36083 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-28  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/wbc-gtk.c (wbc_gtk_create_status_area): size the autoexpr label to contain
+	  about 25 typical characters and ellipsize it on the left
+	* src/workbook-view.c (wb_view_auto_expr_recalc): format teh autoexpression to an
+	  appropriate length
+	
 2010-07-28  Morten Welinder  <terra gnome org>
 
 	* src/style-border.h (struct _GnmBorder): Eliminate unused
diff --git a/NEWS b/NEWS
index a11c492..96d675b 100644
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,7 @@ Andreas:
 	* Fix import of underlined/double underlined comments from xls.
 	  Part of [#405951]
 	* Improve xl import of underlines.
+	* Correctly size the autoexpressions. [#625521]
 
 Jean:
 	* Fix strong/weak cursor display. [#623241]
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 767bd63..a1d5b16 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4587,11 +4587,12 @@ wbc_gtk_create_status_area (WBCGtk *wbcg)
 
 	wbcg->auto_expr_label = tmp = gtk_label_new ("");
 	g_object_ref (wbcg->auto_expr_label);
+	gtk_label_set_ellipsize (GTK_LABEL (tmp), PANGO_ELLIPSIZE_START);
 	GTK_WIDGET_UNSET_FLAGS (tmp, GTK_CAN_FOCUS);
 	gtk_widget_ensure_style (tmp);
 	gtk_widget_set_size_request (tmp, go_pango_measure_string (
 		gtk_widget_get_pango_context (GTK_WIDGET (wbcg->toplevel)),
-		tmp->style->font_desc, "W") * 15, -1);
+		tmp->style->font_desc, "Sumerage=-012345678901234"), -1);
 	tmp = gtk_event_box_new ();
 	gtk_container_add (GTK_CONTAINER (tmp), wbcg->auto_expr_label);
 	g_signal_connect (G_OBJECT (tmp),
diff --git a/src/workbook-view.c b/src/workbook-view.c
index 54a0257..55d963b 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -534,7 +534,10 @@ wb_view_auto_expr_recalc (WorkbookView *wbv)
 			gsize old_len = str->len;
 
 			format_value_gstring (str, format, v, &color,
-					      -1, workbook_date_conv (wb_view_get_workbook (wbv)));
+					      /* Note that we created a label large enough for */
+					      /* "Sumerage=-012345678901234" */
+					      25 - g_utf8_strlen (str->str, -1), 
+					      workbook_date_conv (wb_view_get_workbook (wbv)));
 			go_format_unref (tmp_format);
 
 			attrs = pango_attr_list_new ();



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