aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-spinner.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-spinner.c')
-rw-r--r--widgets/misc/e-spinner.c22
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);