From 22f72cc08e20c7871d93f05375fe2bafb0c1023a Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Fri, 15 Sep 2000 00:08:06 +0000 Subject: Fix some crashes Make double clicking on the header dividers automatically Fix some crashes Make double clicking on the header dividers automatically size the header to it's best fit. When dragging onto the header check the dragged item is a header object. Check the column is resizeable before setting the cursor to <-> Use the font and themes to draw the table and items. svn path=/trunk/; revision=5438 --- widgets/table/e-table.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'widgets/table/e-table.c') diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index b40d7e4df8..cbc7ec3e4d 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -203,7 +203,17 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ { gnome_canvas_set_scroll_region ( GNOME_CANVAS (e_table->header_canvas), - 0, 0, alloc->width - 1, COLUMN_HEADER_HEIGHT - 1); + 0, 0, alloc->width - 1, /* COLUMN_HEADER_HEIGHT - 1 */ + E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1); + + /* When the header item is created ->height == 0, + as the font is only created when everything is realized. + So we set the usize here as well, so that the size of the + header is correct */ + if (GTK_WIDGET (e_table->header_canvas)->allocation.height != + E_TABLE_HEADER_ITEM (e_table->header_item)->height) + gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -1, + E_TABLE_HEADER_ITEM (e_table->header_item)->height); } static void @@ -234,7 +244,8 @@ e_table_setup_header (ETable *e_table) GTK_OBJECT (e_table->header_canvas), "size_allocate", GTK_SIGNAL_FUNC (header_canvas_size_allocate), e_table); - gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -1, COLUMN_HEADER_HEIGHT); + gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -1, + E_TABLE_HEADER_ITEM (e_table->header_item)->height); } static gboolean -- cgit