From 2def5aacb2ade53ff07a9d6b9f63438fe01e877b Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 23 Oct 2001 19:48:19 +0000 Subject: Got rid of the gc argument to e_table_header_draw_button. 2001-10-23 Christopher James Lahey * e-table-field-chooser-item.c: Got rid of the gc argument to e_table_header_draw_button. (etfci_font_load): Just use the style font here. * e-table-group-container.c (e_table_group_container_construct): Changed this to just use the font from the style. Fixes Ximian bug #11882. * e-table-header-item.c: Got rid of the gc argument to e_table_header_draw_button. (ethi_font_load): Changed this to just fallback on the font from the style if the fontname is NULL or doesn't load to a font. Fixes Ximian bug #11882. * e-table-header-utils.c, e-table-header-utils.h (e_table_header_draw_button): Got rid of the gc parameter here and changed to use the gc from the style of a button created for this purpose, but not shown. Fixes Ximian bug #13251. svn path=/trunk/; revision=13949 --- widgets/table/e-table-header-utils.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (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 0933359206..3353c35d60 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -191,6 +191,8 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, return pixmap; } +static GtkWidget *g_label; + /** * e_table_header_draw_button: * @drawable: Destination drawable. @@ -213,7 +215,7 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, void e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, GtkStyle *style, GdkFont *font, GtkStateType state, - GtkWidget *widget, GdkGC *gc, + GtkWidget *widget, int x, int y, int width, int height, int button_width, int button_height, ETableColArrow arrow) @@ -221,6 +223,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, int xthick, ythick; int inner_x, inner_y; int inner_width, inner_height; + GdkGC *gc; g_return_if_fail (drawable != NULL); g_return_if_fail (ecol != NULL); @@ -231,6 +234,18 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (button_width > 0 && button_height > 0); + if (g_label == NULL) { + GtkWidget *button = gtk_button_new_with_label("Hi"); + GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + g_label = GTK_BIN(button)->child; + gtk_container_add (GTK_CONTAINER (window), button); + gtk_widget_ensure_style (window); + gtk_widget_ensure_style (button); + gtk_widget_ensure_style (g_label); + } + + gc = g_label->style->fg_gc[GTK_STATE_NORMAL]; + xthick = style->klass->xthickness; ythick = style->klass->ythickness; -- cgit