aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-text.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-06-04 05:54:37 +0800
committerChris Lahey <clahey@src.gnome.org>2002-06-04 05:54:37 +0800
commitccc7bafebeb202b0f7f7f19b23f76a2105bf2068 (patch)
tree25996cd7397728c97ebbc6113ac947a8ab66059a /widgets/table/e-cell-text.c
parentbf0fa9c240d89229fb33f5a02e0360e248d83f7b (diff)
downloadgsoc2013-evolution-ccc7bafebeb202b0f7f7f19b23f76a2105bf2068.tar.gz
gsoc2013-evolution-ccc7bafebeb202b0f7f7f19b23f76a2105bf2068.tar.zst
gsoc2013-evolution-ccc7bafebeb202b0f7f7f19b23f76a2105bf2068.zip
Get the font from the style again when the style changes. (init): Checks
2002-06-03 Christopher James Lahey <clahey@ximian.com> * e-cell-text.c (ect_style_set): Get the font from the style again when the style changes. (init): Checks for the environment variable GAL_ELLIPSIS and uses that instead of ... if it is set. * e-table-click-to-add.c (finish_editing): e_table_item_leave_edit before committing. (etcta_event): Added a missing break; here. * e-table-item.c (eti_style_set): On style set, free the height cache, request a reflow and a redraw, and call eti_idle_maybe_show_cursor. (e_table_item_compute_location): Don't call eti_get_height here, just use the cached value. * e-tree.c, e-tree.h (e_tree_get_table_adapter): Added this simple accessor function. svn path=/trunk/; revision=17088
Diffstat (limited to 'widgets/table/e-cell-text.c')
-rw-r--r--widgets/table/e-cell-text.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 6f5ddcc7c1..ee1b333244 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -402,7 +402,6 @@ ect_realize (ECellView *ecell_view)
text_view->font = e_font_from_gdk_name (ect->font_name);
}
if (!text_view->font){
- gdk_font_ref (GTK_WIDGET (text_view->canvas)->style->font);
text_view->font = e_font_from_gdk_font (GTK_WIDGET (text_view->canvas)->style->font);
}
@@ -749,7 +748,20 @@ ect_get_bg_color(ECellView *ecell_view, int row)
return color_spec;
}
-
+
+
+static void
+ect_style_set(ECellView *ecell_view, GtkStyle *old_style)
+{
+ ECellTextView *text_view = (ECellTextView *) ecell_view;
+ ECellText *ect = (ECellText *) ecell_view->ecell;
+
+ if (!ect->font_name) {
+ e_font_unref (text_view->font);
+ text_view->font = e_font_from_gdk_font (GTK_WIDGET (text_view->canvas)->style->font);
+ }
+}
+
/*
@@ -1510,11 +1522,15 @@ ect_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
}
}
+static char *ellipsis_default = NULL;
+static gboolean use_ellipsis_default = TRUE;
+
static void
e_cell_text_class_init (GtkObjectClass *object_class)
{
ECellClass *ecc = (ECellClass *) object_class;
ECellTextClass *ectc = (ECellTextClass *) object_class;
+ char *ellipsis_env;
object_class->destroy = ect_destroy;
@@ -1536,6 +1552,7 @@ e_cell_text_class_init (GtkObjectClass *object_class)
ecc->max_width_by_row = ect_max_width_by_row;
ecc->show_tooltip = ect_show_tooltip;
ecc->get_bg_color = ect_get_bg_color;
+ ecc->style_set = ect_style_set;
ectc->get_text = ect_real_get_text;
ectc->free_text = ect_real_free_text;
@@ -1559,13 +1576,22 @@ e_cell_text_class_init (GtkObjectClass *object_class)
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+
+ ellipsis_env = getenv ("GAL_ELLIPSIS");
+ if (ellipsis_env) {
+ if (*ellipsis_env) {
+ ellipsis_default = g_strdup (ellipsis_env);
+ } else {
+ use_ellipsis_default = FALSE;
+ }
+ }
}
static void
e_cell_text_init (ECellText *ect)
{
- ect->ellipsis = NULL;
- ect->use_ellipsis = TRUE;
+ ect->ellipsis = g_strdup (ellipsis_default);
+ ect->use_ellipsis = use_ellipsis_default;
ect->strikeout_column = -1;
ect->bold_column = -1;
ect->color_column = -1;