diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-24 23:22:31 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 01:51:38 +0800 |
commit | d9d9d7f0efad7a1b4464b541201d922cd373c3f4 (patch) | |
tree | 6601fb6e476d54a66e33740c0a29cbe2e7a1efc4 | |
parent | 06943232b36b6ef99051c375db76974065e028d2 (diff) | |
download | gsoc2013-evolution-d9d9d7f0efad7a1b4464b541201d922cd373c3f4.tar.gz gsoc2013-evolution-d9d9d7f0efad7a1b4464b541201d922cd373c3f4.tar.zst gsoc2013-evolution-d9d9d7f0efad7a1b4464b541201d922cd373c3f4.zip |
Restore update method in ECanvasBackground
Restore the update() method in ECanvasBackground. Without a redraw
request the draw() method is never called. For some reason this isn't
noticeable on gtk+-3.0 -- ETable and ETree backgrounds are still white
-- but on gtk+-2.0 the backgrounds are grey.
-rw-r--r-- | widgets/misc/e-canvas-background.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 9fe59f6feb..80b3bf014e 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -76,6 +76,26 @@ ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl } static void +ecb_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +{ + gdouble x1, y1, x2, y2; + + x1 = item->x1; + y1 = item->y1; + x2 = item->x2; + y2 = item->y2; + + /* The bounds are all constants so we should only have to + * redraw once. */ + ecb_bounds (item, &item->x1, &item->y1, &item->x2, &item->y2); + + if (item->x1 != x1 || item->y1 != y1 || + item->x2 != x2 || item->y2 != y2) + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, item->x2, item->y2); +} + +static void ecb_dispose (GObject *object) { ECanvasBackground *ecb = E_CANVAS_BACKGROUND (object); @@ -217,6 +237,7 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class) object_class->set_property = ecb_set_property; object_class->get_property = ecb_get_property; + item_class->update = ecb_update; item_class->draw = ecb_draw; item_class->point = ecb_point; item_class->bounds = ecb_bounds; |