aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-13 22:58:21 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:19 +0800
commit855ac5276542db2a3b236113dad6af7bc6af8d3c (patch)
tree15b8370e3a936a2bb425b137029df38b8f879443 /widgets/table
parent80bc7035be2d07d14e60b09a624147f6e92d1dc6 (diff)
downloadgsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.tar
gsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.tar.gz
gsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.tar.bz2
gsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.tar.lz
gsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.tar.xz
gsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.tar.zst
gsoc2013-evolution-855ac5276542db2a3b236113dad6af7bc6af8d3c.zip
Merge miscellaneous changes from gtk3 branch.
Mostly coding style and whitespace changes, to reduce diff noise.
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-cell-checkbox.c2
-rw-r--r--widgets/table/e-cell-hbox.c22
-rw-r--r--widgets/table/e-cell-text.c5
-rw-r--r--widgets/table/e-cell-tree.c97
-rw-r--r--widgets/table/e-cell-vbox.c33
-rw-r--r--widgets/table/e-table-header-utils.h6
6 files changed, 101 insertions, 64 deletions
diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c
index 441f6723f3..20f56b443e 100644
--- a/widgets/table/e-cell-checkbox.c
+++ b/widgets/table/e-cell-checkbox.c
@@ -50,13 +50,13 @@ ecc_print (ECellView *ecell_view, GtkPrintContext *context,
cairo_save (cr);
if ( value == 1) {
-
cairo_set_line_width (cr, 2);
cairo_move_to (cr, 3, 11);
cairo_line_to (cr, 7, 14);
cairo_line_to (cr, 11, 5);
cairo_stroke (cr);
}
+
cairo_restore (cr);
}
diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c
index 1e6c4a6efc..6f587db9d2 100644
--- a/widgets/table/e-cell-hbox.c
+++ b/widgets/table/e-cell-hbox.c
@@ -138,9 +138,16 @@ ecv_unrealize (ECellView *ecv)
* ECell::draw method
*/
static void
-ecv_draw (ECellView *ecell_view, GdkDrawable *drawable,
- gint model_col, gint view_col, gint row, ECellFlags flags,
- gint x1, gint y1, gint x2, gint y2)
+ecv_draw (ECellView *ecell_view,
+ GdkDrawable *drawable,
+ gint model_col,
+ gint view_col,
+ gint row,
+ ECellFlags flags,
+ gint x1,
+ gint y1,
+ gint x2,
+ gint y2)
{
ECellHboxView *hbox_view = (ECellHboxView *)ecell_view;
@@ -156,9 +163,12 @@ ecv_draw (ECellView *ecell_view, GdkDrawable *drawable,
if (width < hbox_view->def_size_cols[i])
width = hbox_view->def_size_cols[i];
printf("width of %d %d of %d\n", width,hbox_view->def_size_cols[i], allotted_width ); */
- e_cell_draw (hbox_view->subcell_views[i], drawable,
- hbox_view->model_cols[i], view_col, row, flags,
- x1 + subcell_offset , y1, x1 + subcell_offset + width, y2);
+
+ e_cell_draw (
+ hbox_view->subcell_views[i], drawable,
+ hbox_view->model_cols[i], view_col, row, flags,
+ x1 + subcell_offset , y1,
+ x1 + subcell_offset + width, y2);
subcell_offset += width; /* e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); */
}
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 4d86378904..1b0545cc37 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -736,8 +736,9 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
gchar *color_spec;
GdkColor *cell_foreground;
- color_spec = e_table_model_value_at (ecell_view->e_table_model,
- ect->color_column, row);
+ color_spec = e_table_model_value_at (
+ ecell_view->e_table_model,
+ ect->color_column, row);
cell_foreground = e_cell_text_get_color (text_view,
color_spec);
if (cell_foreground)
diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c
index 5771cbc053..9129fba446 100644
--- a/widgets/table/e-cell-tree.c
+++ b/widgets/table/e-cell-tree.c
@@ -126,8 +126,8 @@ ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view
tree_view->cell_view.ecell = ecell;
tree_view->cell_view.e_table_model = table_model;
tree_view->cell_view.e_table_item_view = e_table_item_view;
- tree_view->cell_view.kill_view_cb = NULL;
- tree_view->cell_view.kill_view_cb_data = NULL;
+ tree_view->cell_view.kill_view_cb = NULL;
+ tree_view->cell_view.kill_view_cb_data = NULL;
/* create our subcell view */
tree_view->subcell_view = e_cell_new_view (ect->subcell, table_model, e_table_item_view /* XXX */);
@@ -145,11 +145,11 @@ ect_kill_view (ECellView *ecv)
{
ECellTreeView *tree_view = (ECellTreeView *) ecv;
- if (tree_view->cell_view.kill_view_cb)
- (tree_view->cell_view.kill_view_cb)(ecv, tree_view->cell_view.kill_view_cb_data);
+ if (tree_view->cell_view.kill_view_cb)
+ (tree_view->cell_view.kill_view_cb)(ecv, tree_view->cell_view.kill_view_cb_data);
- if (tree_view->cell_view.kill_view_cb_data)
- g_list_free (tree_view->cell_view.kill_view_cb_data);
+ if (tree_view->cell_view.kill_view_cb_data)
+ g_list_free (tree_view->cell_view.kill_view_cb_data);
/* kill our subcell view */
e_cell_kill_view (tree_view->subcell_view);
@@ -188,7 +188,11 @@ ect_unrealize (ECellView *ecv)
}
static void
-draw_expander (ECellTreeView *ectv, GdkDrawable *drawable, GtkExpanderStyle expander_style, GtkStateType state, GdkRectangle *rect)
+draw_expander (ECellTreeView *ectv,
+ GdkDrawable *drawable,
+ GtkExpanderStyle expander_style,
+ GtkStateType state,
+ GdkRectangle *rect)
{
GtkStyle *style;
GtkWidget *tree;
@@ -209,9 +213,16 @@ draw_expander (ECellTreeView *ectv, GdkDrawable *drawable, GtkExpanderStyle expa
* ECell::draw method
*/
static void
-ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
- gint model_col, gint view_col, gint row, ECellFlags flags,
- gint x1, gint y1, gint x2, gint y2)
+ect_draw (ECellView *ecell_view,
+ GdkDrawable *drawable,
+ gint model_col,
+ gint view_col,
+ gint row,
+ ECellFlags flags,
+ gint x1,
+ gint y1,
+ gint x2,
+ gint y2)
{
ECellTreeView *tree_view = (ECellTreeView *)ecell_view;
ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
@@ -265,16 +276,16 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
gboolean expanded = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node);
GdkRectangle r;
- r = rect;
- r.width -= node_image_width + 2;
- draw_expander (tree_view, drawable, expanded ? GTK_EXPANDER_EXPANDED : GTK_EXPANDER_COLLAPSED, GTK_STATE_NORMAL, &r);
+ r = rect;
+ r.width -= node_image_width + 2;
+ draw_expander (tree_view, drawable, expanded ? GTK_EXPANDER_EXPANDED : GTK_EXPANDER_COLLAPSED, GTK_STATE_NORMAL, &r);
}
if (node_image) {
- gdk_cairo_set_source_pixbuf (cr, node_image,
- x1 + subcell_offset,
- y1 + (y2 - y1) / 2 - node_image_height / 2);
- cairo_paint (cr);
+ gdk_cairo_set_source_pixbuf (cr, node_image,
+ x1 + subcell_offset,
+ y1 + (y2 - y1) / 2 - node_image_height / 2);
+ cairo_paint (cr);
subcell_offset += node_image_width;
}
@@ -394,30 +405,30 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col
if (event_in_expander (event, offset, 0)) {
if (e_tree_model_node_is_expandable (tree_model, node)) {
gboolean expanded = e_tree_table_adapter_node_is_expanded (etta, node);
- gint tmp_row = row;
- GdkRectangle area;
- animate_closure_t *closure = g_new0 (animate_closure_t, 1);
- gint hgt;
-
- e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view,
- &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
- area.width = offset - 2;
- hgt = e_cell_height (ecell_view, model_col, view_col, row);
-
- if (hgt != area.height) /* Composite cells */
- area.height += hgt;
-
- draw_expander (
- tree_view, window, expanded ?
- GTK_EXPANDER_SEMI_EXPANDED :
- GTK_EXPANDER_SEMI_COLLAPSED,
- GTK_STATE_NORMAL, &area);
- closure->ectv = tree_view;
- closure->etta = etta;
- closure->node = node;
- closure->expanded = expanded;
- closure->area = area;
- tree_view->animate_timeout = g_timeout_add (50, animate_expander, closure);
+ gint tmp_row = row;
+ GdkRectangle area;
+ animate_closure_t *closure = g_new0 (animate_closure_t, 1);
+ gint hgt;
+
+ e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view,
+ &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
+ area.width = offset - 2;
+ hgt = e_cell_height (ecell_view, model_col, view_col, row);
+
+ if (hgt != area.height) /* Composite cells */
+ area.height += hgt;
+
+ draw_expander (
+ tree_view, window, expanded ?
+ GTK_EXPANDER_SEMI_EXPANDED :
+ GTK_EXPANDER_SEMI_COLLAPSED,
+ GTK_STATE_NORMAL, &area);
+ closure->ectv = tree_view;
+ closure->etta = etta;
+ closure->node = node;
+ closure->expanded = expanded;
+ closure->area = area;
+ tree_view->animate_timeout = g_timeout_add (50, animate_expander, closure);
return TRUE;
}
}
@@ -531,8 +542,8 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col)
expanded = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node);
/* This is unnecessary since this is already handled
- by the offset_of_node function. If that changes,
- this will have to change too. */
+ * by the offset_of_node function. If that changes,
+ * this will have to change too. */
if (expandable) {
GdkPixbuf *image;
diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c
index f752e14834..b170604ade 100644
--- a/widgets/table/e-cell-vbox.c
+++ b/widgets/table/e-cell-vbox.c
@@ -131,9 +131,16 @@ ecv_unrealize (ECellView *ecv)
* ECell::draw method
*/
static void
-ecv_draw (ECellView *ecell_view, GdkDrawable *drawable,
- gint model_col, gint view_col, gint row, ECellFlags flags,
- gint x1, gint y1, gint x2, gint y2)
+ecv_draw (ECellView *ecell_view,
+ GdkDrawable *drawable,
+ gint model_col,
+ gint view_col,
+ gint row,
+ ECellFlags flags,
+ gint x1,
+ gint y1,
+ gint x2,
+ gint y2)
{
ECellVboxView *vbox_view = (ECellVboxView *)ecell_view;
@@ -143,12 +150,20 @@ ecv_draw (ECellView *ecell_view, GdkDrawable *drawable,
for (i = 0; i < vbox_view->subcell_view_count; i++) {
/* Now cause our subcells to draw their contents,
shifted by subcell_offset pixels */
- gint height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row);
- e_cell_draw (vbox_view->subcell_views[i], drawable,
- vbox_view->model_cols[i], view_col, row, flags,
- x1, y1 + subcell_offset, x2, y1 + subcell_offset + height);
-
- subcell_offset += e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row);
+ gint height;
+
+ height = e_cell_height (
+ vbox_view->subcell_views[i],
+ vbox_view->model_cols[i], view_col, row);
+ e_cell_draw (
+ vbox_view->subcell_views[i], drawable,
+ vbox_view->model_cols[i], view_col, row, flags,
+ x1, y1 + subcell_offset, x2,
+ y1 + subcell_offset + height);
+
+ subcell_offset += e_cell_height (
+ vbox_view->subcell_views[i],
+ vbox_view->model_cols[i], view_col, row);
}
}
diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h
index 9117262d52..16cc867f8c 100644
--- a/widgets/table/e-table-header-utils.h
+++ b/widgets/table/e-table-header-utils.h
@@ -31,9 +31,9 @@
G_BEGIN_DECLS
gdouble e_table_header_compute_height (ETableCol *ecol,
- GtkWidget *widget);
-gdouble e_table_header_width_extras (GtkStyle *style);
-void e_table_header_draw_button (GdkDrawable *drawable,
+ GtkWidget *widget);
+gdouble e_table_header_width_extras (GtkStyle *style);
+void e_table_header_draw_button (GdkDrawable *drawable,
ETableCol *ecol,
GtkStyle *style,
GtkStateType state,