goocanvas r11 - in trunk: . demo src
- From: damon svn gnome org
- To: svn-commits-list gnome org
- Subject: goocanvas r11 - in trunk: . demo src
- Date: Tue, 2 Sep 2008 09:14:05 +0000 (UTC)
Author: damon
Date: Tue Sep 2 09:14:05 2008
New Revision: 11
URL: http://svn.gnome.org/viewvc/goocanvas?rev=11&view=rev
Log:
2008-09-02 Damon Chaplin <damon gnome org>
* src/goocanvastable.c (goo_canvas_table_paint): use the item's
fill and stroke colors for the table background and grid.
* demo/table-demo.c: test the above.
Modified:
trunk/ChangeLog
trunk/demo/table-demo.c
trunk/src/goocanvastable.c
Modified: trunk/demo/table-demo.c
==============================================================================
--- trunk/demo/table-demo.c (original)
+++ trunk/demo/table-demo.c Tue Sep 2 09:14:05 2008
@@ -29,6 +29,7 @@
GooCanvasItem *item;
item = goo_canvas_rect_new (table, 0, 0, width, height,
+ "stroke-color", "black",
"fill-color", "red",
NULL);
@@ -76,6 +77,8 @@
"y-border-spacing", 1.0,
"horz-grid-line-width", 1.0,
"vert-grid-line-width", 2.0,
+ "stroke-color", "blue",
+ "fill-color", "lightblue",
NULL);
}
Modified: trunk/src/goocanvastable.c
==============================================================================
--- trunk/src/goocanvastable.c (original)
+++ trunk/src/goocanvastable.c Tue Sep 2 09:14:05 2008
@@ -2193,6 +2193,7 @@
{
GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item;
GooCanvasItemSimpleData *simple_data = simple->simple_data;
+ GooCanvasStyle *style = simple_data->style;
GooCanvasGroup *group = (GooCanvasGroup*) item;
GooCanvasTable *table = (GooCanvasTable*) item;
GooCanvasTableData *table_data = table->table_data;
@@ -2264,7 +2265,22 @@
cairo_clip (cr);
}
- cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
+ /* Fill the table, if desired. */
+ if (goo_canvas_style_set_fill_options (style, cr))
+ {
+ cairo_rectangle (cr,
+ layout_data->border_width + vert_grid_line_width,
+ layout_data->border_width + horz_grid_line_width,
+ layout_data->allocated_size[HORZ] - 2 * (layout_data->border_width + vert_grid_line_width),
+ layout_data->allocated_size[VERT] - 2 * (layout_data->border_width + horz_grid_line_width));
+ cairo_fill (cr);
+ }
+
+ /* We use the style for the stroke color, but the line cap style and line
+ width are overridden here. */
+ goo_canvas_style_set_stroke_options (style, cr);
+
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
/* Horizontal grid lines */
if (horz_grid_line_width > 0.0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]