]> git.0d.be Git - empathy.git/blobdiff - src/ephy-spinner.c
Updated Polish translation
[empathy.git] / src / ephy-spinner.c
index e7285bc0dc8fe1e4fda75399e547446e324cdba0..7efacb18aec31fda233be5a70d019b3973360c28 100644 (file)
@@ -392,7 +392,7 @@ ephy_spinner_cache_get_images (EphySpinnerCache *cache,
 
        LOG ("Getting animation images for screen %p at size %d", screen, icon_size);
 
-       g_return_val_if_fail (icon_size >= 0 && icon_size < LAST_ICON_SIZE, NULL);
+       g_return_val_if_fail (icon_size < LAST_ICON_SIZE, NULL);
 
        /* Backward compat: "invalid" meant "native" size which doesn't exist anymore */
        if (icon_size == GTK_ICON_SIZE_INVALID)
@@ -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;
        }
@@ -642,8 +643,7 @@ ephy_spinner_expose (GtkWidget *widget,
        /* Otherwise |images| will be NULL anyway */
        g_assert (images->n_animation_pixbufs > 0);
                
-       g_assert (details->current_image >= 0 &&
-                 details->current_image < images->n_animation_pixbufs);
+       g_assert (details->current_image < images->n_animation_pixbufs);
 
        pixbuf = images->animation_pixbufs[details->current_image];
 
@@ -653,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;
 
@@ -668,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);