aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-spinner.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2009-11-13 13:29:35 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2009-11-17 07:53:40 +0800
commit6f9fe3b417a3870ce48288f1273843af05d39624 (patch)
treebf9836bcf0e67793ee18e3beca4835880ed656aa /src/ephy-spinner.c
parente836a987945a601d70082eef2c6f2fd6796c4fd3 (diff)
downloadgsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.gz
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.bz2
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.lz
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.xz
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.zst
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.zip
Use accessor functions instead direct access.
Some functions still remaining because there is not API in GTK+ 2.19.0 yet. http://bugzilla.gnome.org/show_bug.cgi?id=586476 Reviewed-By: Danielle Madeley <danielle.madeley@collabora.co.uk>
Diffstat (limited to 'src/ephy-spinner.c')
-rw-r--r--src/ephy-spinner.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ephy-spinner.c b/src/ephy-spinner.c
index d2d50453c..7efacb18a 100644
--- a/src/ephy-spinner.c
+++ b/src/ephy-spinner.c
@@ -601,7 +601,7 @@ ephy_spinner_init (EphySpinner *spinner)
details = spinner->details = EPHY_SPINNER_GET_PRIVATE (spinner);
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (spinner), GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE);
details->cache = ephy_spinner_cache_ref ();
details->size = GTK_ICON_SIZE_DIALOG;
@@ -621,8 +621,9 @@ ephy_spinner_expose (GtkWidget *widget,
GdkGC *gc;
int x_offset, y_offset, width, height;
GdkRectangle pix_area, dest;
+ GtkAllocation allocation;
- if (!GTK_WIDGET_DRAWABLE (spinner))
+ if (!gtk_widget_is_drawable (GTK_WIDGET (spinner)))
{
return FALSE;
}
@@ -652,11 +653,12 @@ ephy_spinner_expose (GtkWidget *widget,
height = gdk_pixbuf_get_height (pixbuf);
/* Compute the offsets for the image centered on our allocation */
- x_offset = (widget->allocation.width - width) / 2;
- y_offset = (widget->allocation.height - height) / 2;
+ gtk_widget_get_allocation (widget, &allocation);
+ 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;
@@ -667,8 +669,8 @@ ephy_spinner_expose (GtkWidget *widget,
gc = gdk_gc_new (gtk_widget_get_window (widget));
gdk_draw_pixbuf (gtk_widget_get_window (widget), gc, pixbuf,
- dest.x - x_offset - widget->allocation.x,
- dest.y - y_offset - widget->allocation.y,
+ 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);