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 | |
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')
-rw-r--r-- | widgets/e-table/ChangeLog | 6 | ||||
-rw-r--r-- | widgets/e-table/e-table-item.c | 13 | ||||
-rw-r--r-- | widgets/table/e-table-item.c | 13 |
3 files changed, 28 insertions, 4 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 5e247bf5b5..0d1d829be1 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,9 @@ +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. + 2000-04-17 Chris Toshok <toshok@helixcode.com> * Makefile.am (noinst_PROGRAMS): add table-size-test diff --git a/widgets/e-table/e-table-item.c b/widgets/e-table/e-table-item.c index 0b8c106a27..6c0a05db40 100644 --- a/widgets/e-table/e-table-item.c +++ b/widgets/e-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); } /* 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); } /* |