From 2d3c06b3a4157382686a992800c60473bcc61c49 Mon Sep 17 00:00:00 2001 From: Jason Leach Date: Sun, 29 Apr 2001 01:14:50 +0000 Subject: (Make the alternating row colors a option in ETableSpecification instead 2001-04-28 Jason Leach (Make the alternating row colors a option in ETableSpecification instead of a compiled in #define) * e-table-specification.c (e_table_specification_load_from_node): Read in the "alternating-row-colors=bool" option for ETableSpecifications. Default value is true so unless it is specified to be false, row colors will alternate. (e_table_specification_save_to_node): Save the alternating row color options here. * e-table.c (et_build_groups): Pass down the alternating row colors through to the ETableGroup. * e-table-group-container.[ch]: Handle the new alternating row colors option here, passing it to ETableItem. * e-table-group-leaf.[ch]: Here too. * e-table-item.c (eti_get_cell_background_color): Got rid of the #define ALTERNATE_COLORS, replaced with truth check for ETableItem::alternating_row_colors. * e-tree.c: Make ETree recognize alternating row color options as well. svn path=/trunk/; revision=9622 --- widgets/table/e-table-group-container.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'widgets/table/e-table-group-container.c') diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 5812910643..5d55d17415 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -35,6 +35,7 @@ enum { ARG_WIDTH, ARG_MINIMUM_WIDTH, ARG_FROZEN, + ARG_TABLE_ALTERNATING_ROW_COLORS, ARG_TABLE_HORIZONTAL_DRAW_GRID, ARG_TABLE_VERTICAL_DRAW_GRID, ARG_TABLE_DRAW_FOCUS, @@ -412,6 +413,7 @@ create_child_node (ETableGroupContainer *etgc, void *val) child = e_table_group_new (GNOME_CANVAS_GROUP (etgc), etg->full_header, etg->header, etg->model, etgc->sort_info, etgc->n + 1); gnome_canvas_item_set(GNOME_CANVAS_ITEM(child), + "alternating_row_colors", etgc->alternating_row_colors, "horizontal_draw_grid", etgc->horizontal_draw_grid, "vertical_draw_grid", etgc->vertical_draw_grid, "drawfocus", etgc->draw_focus, @@ -749,6 +751,16 @@ etgc_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } break; + case ARG_TABLE_ALTERNATING_ROW_COLORS: + etgc->alternating_row_colors = GTK_VALUE_BOOL (*arg); + for (list = etgc->children; list; list = g_list_next (list)) { + ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; + gtk_object_set (GTK_OBJECT(child_node->child), + "alternating_row_colors", GTK_VALUE_BOOL (*arg), + NULL); + } + break; + case ARG_TABLE_HORIZONTAL_DRAW_GRID: etgc->horizontal_draw_grid = GTK_VALUE_BOOL (*arg); for (list = etgc->children; list; list = g_list_next (list)) { @@ -847,6 +859,8 @@ etgc_class_init (GtkObjectClass *object_class) e_group_class->compute_location = etgc_compute_location; e_group_class->get_cell_geometry = etgc_get_cell_geometry; + gtk_object_add_arg_type ("ETableGroupContainer::alternating_row_colors", GTK_TYPE_BOOL, + GTK_ARG_WRITABLE, ARG_TABLE_ALTERNATING_ROW_COLORS); gtk_object_add_arg_type ("ETableGroupContainer::horizontal_draw_grid", GTK_TYPE_BOOL, GTK_ARG_WRITABLE, ARG_TABLE_HORIZONTAL_DRAW_GRID); gtk_object_add_arg_type ("ETableGroupContainer::vertical_draw_grid", GTK_TYPE_BOOL, @@ -959,6 +973,7 @@ etgc_init (GtkObject *object) e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM(object), etgc_reflow); + container->alternating_row_colors = 1; container->horizontal_draw_grid = 1; container->vertical_draw_grid = 1; container->draw_focus = 1; -- cgit