From a6d296b998729abc78e634844cc4a3aeda7d0327 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 12 Jan 2010 17:54:29 -0500 Subject: Baby steps toward GSEAL compliance. --- widgets/misc/e-spinner.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'widgets/misc/e-spinner.c') 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); -- cgit v1.2.3