diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-13 06:54:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-14 03:17:42 +0800 |
commit | a6d296b998729abc78e634844cc4a3aeda7d0327 (patch) | |
tree | 136c24bd250a288f8152cd563969f3954adc75be /widgets/misc/e-spinner.c | |
parent | 4d114e022ca38e7aeb6cc2cc3715f7dca69c82a6 (diff) | |
download | gsoc2013-evolution-a6d296b998729abc78e634844cc4a3aeda7d0327.tar.gz gsoc2013-evolution-a6d296b998729abc78e634844cc4a3aeda7d0327.tar.zst gsoc2013-evolution-a6d296b998729abc78e634844cc4a3aeda7d0327.zip |
Baby steps toward GSEAL compliance.
Diffstat (limited to 'widgets/misc/e-spinner.c')
-rw-r--r-- | widgets/misc/e-spinner.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/widgets/misc/e-spinner.c b/widgets/misc/e-spinner.c index 3e7b732def..c95f26b0a7 100644 --- a/widgets/misc/e-spinner.c +++ b/widgets/misc/e-spinner.c @@ -640,7 +640,9 @@ e_spinner_expose (GtkWidget *widget, ESpinner *spinner = E_SPINNER (widget); ESpinnerDetails *details = spinner->details; ESpinnerImages *images; + GtkAllocation allocation; GdkPixbuf *pixbuf; + GdkWindow *window; GdkGC *gc; gint x_offset, y_offset, width, height; GdkRectangle pix_area, dest; @@ -675,12 +677,14 @@ e_spinner_expose (GtkWidget *widget, width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); + gtk_widget_get_allocation (widget, &allocation); + /* Compute the offsets for the image centered on our allocation */ - x_offset = (widget->allocation.width - width) / 2; - y_offset = (widget->allocation.height - height) / 2; + x_offset = (allocation.width - width) / 2; + y_offset = (allocation.height - height) / 2; - pix_area.x = x_offset + widget->allocation.x; - pix_area.y = y_offset + widget->allocation.y; + pix_area.x = x_offset + allocation.x; + pix_area.y = y_offset + allocation.y; pix_area.width = width; pix_area.height = height; @@ -689,10 +693,12 @@ e_spinner_expose (GtkWidget *widget, return FALSE; } - gc = gdk_gc_new (widget->window); - gdk_draw_pixbuf (widget->window, gc, pixbuf, - dest.x - x_offset - widget->allocation.x, - dest.y - y_offset - widget->allocation.y, + window = gtk_widget_get_window (widget); + + gc = gdk_gc_new (window); + gdk_draw_pixbuf (window, gc, pixbuf, + dest.x - x_offset - allocation.x, + dest.y - y_offset - allocation.y, dest.x, dest.y, dest.width, dest.height, GDK_RGB_DITHER_MAX, 0, 0); |