aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-item.c
diff options
context:
space:
mode:
authorJason Leach <jasonleach@usa.net>2001-04-29 09:14:50 +0800
committerJacob Leach <jleach@src.gnome.org>2001-04-29 09:14:50 +0800
commit2d3c06b3a4157382686a992800c60473bcc61c49 (patch)
tree8a152108d5d609e9bd399d1de077f60fc9a48932 /widgets/table/e-table-item.c
parent30cc6ee6daceb7089ebab1f833e32287f253bb2a (diff)
downloadgsoc2013-evolution-2d3c06b3a4157382686a992800c60473bcc61c49.tar.gz
gsoc2013-evolution-2d3c06b3a4157382686a992800c60473bcc61c49.tar.zst
gsoc2013-evolution-2d3c06b3a4157382686a992800c60473bcc61c49.zip
(Make the alternating row colors a option in ETableSpecification instead
2001-04-28 Jason Leach <jasonleach@usa.net> (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
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r--widgets/table/e-table-item.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 2509299fe2..86bc45e323 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -33,7 +33,6 @@
#define FOCUSED_BORDER 2
#define DO_TOOLTIPS 1
-#define ALTERNATE_COLORS 1
#define d(x)
@@ -60,6 +59,7 @@ enum {
ARG_TABLE_HEADER,
ARG_TABLE_MODEL,
ARG_SELECTION_MODEL,
+ ARG_TABLE_ALTERNATING_ROW_COLORS,
ARG_TABLE_HORIZONTAL_DRAW_GRID,
ARG_TABLE_VERTICAL_DRAW_GRID,
ARG_TABLE_DRAW_FOCUS,
@@ -168,17 +168,17 @@ eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selec
background = &canvas->style->base [GTK_STATE_NORMAL];
}
-#ifdef ALTERNATE_COLORS
- if (row % 2) {
+ if (eti->alternating_row_colors) {
+ if (row % 2) {
- } else {
- if (allocated)
- *allocated = TRUE;
- background = gdk_color_copy (background);
- e_hsv_tweak (background, 0.0f, 0.0f, -0.05f);
- gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (canvas)), background);
+ } else {
+ if (allocated)
+ *allocated = TRUE;
+ background = gdk_color_copy (background);
+ e_hsv_tweak (background, 0.0f, 0.0f, -0.05f);
+ gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (canvas)), background);
+ }
}
-#endif
return background;
}
@@ -1064,6 +1064,10 @@ eti_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
eti->length_threshold = GTK_VALUE_INT (*arg);
break;
+ case ARG_TABLE_ALTERNATING_ROW_COLORS:
+ eti->alternating_row_colors = GTK_VALUE_BOOL (*arg);
+ break;
+
case ARG_TABLE_HORIZONTAL_DRAW_GRID:
eti->horizontal_draw_grid = GTK_VALUE_BOOL (*arg);
break;
@@ -2106,6 +2110,8 @@ eti_class_init (GtkObjectClass *object_class)
GTK_ARG_WRITABLE, ARG_TABLE_MODEL);
gtk_object_add_arg_type ("ETableItem::selection_model", E_SELECTION_MODEL_TYPE,
GTK_ARG_WRITABLE, ARG_SELECTION_MODEL);
+ gtk_object_add_arg_type ("ETableItem::alternating_row_colors", GTK_TYPE_BOOL,
+ GTK_ARG_WRITABLE, ARG_TABLE_ALTERNATING_ROW_COLORS);
gtk_object_add_arg_type ("ETableItem::horizontal_draw_grid", GTK_TYPE_BOOL,
GTK_ARG_WRITABLE, ARG_TABLE_HORIZONTAL_DRAW_GRID);
gtk_object_add_arg_type ("ETableItem::vertical_draw_grid", GTK_TYPE_BOOL,