From 874390a8376202f138266bdd641e810db93a3136 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 2 May 2002 20:32:19 +0000 Subject: Added this function that lets you specify the translation domain. 2002-05-02 Christopher James Lahey * gal/widgets/e-popup-menu.c, gal/widgets/e-popup-menu.h (e_popup_menu_create_with_domain): Added this function that lets you specify the translation domain. From gal/e-table/ChangeLog: 2002-05-02 Christopher James Lahey * e-table-click-to-add.c (finish_editing): Add horizontal dividers here too. * e-table-config.c (create_global_store): Translate column headers here. * e-table-header-item.c (ethi_header_context_menu): Use e_popup_menu_create_with_domain here. * e-table-header-utils.c (e_table_header_draw_button): Translate from utf8 here before drawing. * e-table-memory-store.c, e-table-memory-store.h (e_table_memory_store_insert_adopt_array): Changed the name of this function from e_table_memory_store_insert_adopt. (e_table_memory_store_insert_adopt): Added this function which takes a ... list. * e-table-utils.c (et_col_spec_to_col): Translate column titles to utf8 here. svn path=/trunk/; revision=16668 --- widgets/table/e-table-header-utils.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'widgets/table/e-table-header-utils.c') diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index d5000a9800..9668250961 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -27,10 +27,12 @@ #include #endif +#include "e-table-header-utils.h" + #include /* strlen() */ #include #include "e-table-defines.h" -#include "e-table-header-utils.h" +#include @@ -225,6 +227,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, int inner_x, inner_y; int inner_width, inner_height; GdkGC *gc; + char *text; g_return_if_fail (drawable != NULL); g_return_if_fail (ecol != NULL); @@ -302,6 +305,8 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, /* Pixbuf or label */ + text = e_utf8_to_gtk_string (widget, ecol->text); + if (ecol->is_pixbuf) { int pwidth, pheight; int clip_width, clip_height; @@ -323,7 +328,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, int width; int ypos; - gdk_string_extents (font, ecol->text, NULL, &rbearing, &width, NULL, NULL); + gdk_string_extents (font, text, NULL, &rbearing, &width, NULL, NULL); if (rbearing < inner_width - (pwidth + 1)) { xpos = inner_x + (inner_width - width - (pwidth + 1)) / 2; } @@ -332,7 +337,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, e_table_draw_elided_string (drawable, font, gc, xpos + pwidth + 1, ypos, - ecol->text, inner_width - (xpos - inner_x), FALSE); + text, inner_width - (xpos - inner_x), FALSE); } pixmap = make_composite_pixmap (drawable, gc, @@ -355,8 +360,9 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, e_table_draw_elided_string (drawable, font, gc, inner_x, ypos, - ecol->text, inner_width, TRUE); + text, inner_width, TRUE); } + g_free (text); } /* Computes the length of a string that needs to be trimmed for elision */ -- cgit