diff options
author | Iain Holmes <ih@csd.abdn.ac.uk> | 2000-04-24 04:16:37 +0800 |
---|---|---|
committer | iholmes <iholmes@localhost> | 2000-04-24 04:16:37 +0800 |
commit | bfef6be0fc6a571c6e229ea546a216a662df78f4 (patch) | |
tree | 5a4f7dda81b2d2e30d66363b5f8a483697a548e8 /widgets/table | |
parent | 49c2cb5af1a58b24fc08d2ce351307a4cfad96f5 (diff) | |
download | gsoc2013-evolution-bfef6be0fc6a571c6e229ea546a216a662df78f4.tar.gz gsoc2013-evolution-bfef6be0fc6a571c6e229ea546a216a662df78f4.tar.zst gsoc2013-evolution-bfef6be0fc6a571c6e229ea546a216a662df78f4.zip |
Calculate the width of the table from the width of all the columns, and
2000-04-23 Iain Holmes <ih@csd.abdn.ac.uk>
* e-table-item.c (eti_bounds): Calculate the width of the table from the
width of all the columns, and update the eti->width field as appropiate.
(eti_update): Update the bbox.
svn path=/trunk/; revision=2572
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-item.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 0b8c106a27..6c0a05db40 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -139,12 +139,20 @@ eti_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y { double i2c [6]; ArtPoint c1, c2, i1, i2; + int col, width = 0; ETableItem *eti = E_TABLE_ITEM (item); /* Wrong BBox's are the source of redraw nightmares */ - gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (eti), i2c); + for (col = 0; col < eti->cols; col++, x1 = x2){ + ETableCol *ecol = e_table_header_get_column (eti->header, col); + + width += ecol->width; + } + eti->width = width; + gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (eti), i2c); + i1.x = eti->x1; i1.y = eti->y1; i2.x = eti->x1 + eti->width; @@ -188,7 +196,6 @@ eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->update) (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->update)(item, affine, clip_path, flags); - o1.x = item->x1; o1.y = item->y1; o2.x = item->x2; @@ -208,6 +215,8 @@ eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) item->x2, item->y2); eti->needs_redraw = 0; } + gnome_canvas_update_bbox (item, item->x1, item->y1, + item->x2, item->y2); } /* |