[gnumeric] GUI: fix ellipsizing problem with auto-expression.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: fix ellipsizing problem with auto-expression.
- Date: Sat, 31 Dec 2011 22:10:51 +0000 (UTC)
commit bdf5635be7ebb7922f6a1128b2fc4e531980de60
Author: Morten Welinder <terra gnome org>
Date: Sat Dec 31 17:10:28 2011 -0500
GUI: fix ellipsizing problem with auto-expression.
ChangeLog | 6 ++++++
NEWS | 1 +
src/wbc-gtk.c | 4 +++-
src/workbook-view.c | 10 ++++------
4 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1cf27c2..884a1fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-12-31 Morten Welinder <terra gnome org>
+ * src/wbc-gtk.c (wbc_gtk_create_status_area): Beat the auto
+ expression label into submission with respect to ellipsizing.
+
+ * src/workbook-view.c (wb_view_auto_expr_recalc): No need for
+ manual ellipsizing here.
+
* src/workbook-view.h (WorkbookView): Move auto-expression
settings into a sub-structure. All users changed.
diff --git a/NEWS b/NEWS
index d34bac4..8e3433d 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Morten:
* Fix object life-cycle problems in solver.
* Fix multihead problem with format dialog.
* Fix auto-expression problem with sheet deletion.
+ * Fix ellipsizing of auto-expression.
--------------------------------------------------------------------------
Gnumeric 1.11.1
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index cec1ea1..6e27811 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4789,6 +4789,7 @@ wbc_gtk_create_status_area (WBCGtk *wbcg)
{
GtkWidget *tmp, *frame;
GdkRGBA const white = {1.,1.,1.,1.};
+ const char *auto_expr_sample = "Sumerage = -012345678901234";
wbcg->progress_bar = gtk_progress_bar_new ();
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (wbcg->progress_bar), " ");
@@ -4801,10 +4802,11 @@ wbc_gtk_create_status_area (WBCGtk *wbcg)
g_object_ref (wbcg->auto_expr_label);
gtk_label_set_ellipsize (GTK_LABEL (tmp), PANGO_ELLIPSIZE_START);
gtk_widget_set_can_focus (tmp, FALSE);
+ gtk_label_set_max_width_chars (GTK_LABEL (tmp), strlen (auto_expr_sample));
gtk_widget_set_size_request (tmp, go_pango_measure_string (
gtk_widget_get_pango_context (GTK_WIDGET (wbcg->toplevel)),
gtk_style_context_get_font (gtk_widget_get_style_context (tmp), GTK_STATE_NORMAL),
- "Sumerage = -012345678901234"), -1);
+ auto_expr_sample), -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 c2ae12c..4603e5b 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -545,14 +545,12 @@ wb_view_auto_expr_recalc (WorkbookView *wbv)
wbv->auto_expr.cell.row >= 0 &&
wbv->auto_expr.cell.col >= 0) {
GnmValue *v;
+
+ str = g_string_new (wbv->auto_expr.sheet->name_unquoted);
+ g_string_append_c (str, '!');
+
range_init_cellpos (&r, &wbv->auto_expr.cell);
v = value_new_cellrange_r (wbv->auto_expr.sheet, &r);
- if (strlen (wbv->auto_expr.sheet->name_unquoted) < 8) {
- str = g_string_new
- (wbv->auto_expr.sheet->name_unquoted);
- g_string_append_c (str, '!');
- } else
- str = g_string_new ("\342\200\246!");
texpr = gnm_expr_top_new_constant (v);
g_string_append (str, wbv->auto_expr.descr);
} else if (wbv->auto_expr.func != NULL &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]