]> spindle.queued.net Git - midori/commitdiff
Use new GTK+ 3 API to align coords of throbber
authorChristian Dywan <christian@twotoasts.de>
Wed, 14 Dec 2011 01:14:54 +0000 (02:14 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 14 Dec 2011 01:14:54 +0000 (02:14 +0100)
Once again existing API is no longer reliable.

katze/katze-throbber.c

index 0ffc74aa82a1d408798d90f482332e8465f3c77d..d8c71b93e4a92948711a8144c0e1b05d42593594 100644 (file)
@@ -901,8 +901,14 @@ katze_throbber_aligned_coords (GtkWidget* widget,
     gtk_misc_get_padding (GTK_MISC (widget), &xpad, &ypad);
     #endif
 
+    #if GTK_CHECK_VERSION (3, 0, 0)
+    allocation.width = gtk_widget_get_allocated_width (widget);
+    allocation.height = gtk_widget_get_allocated_height (widget);
+    gtk_widget_get_preferred_size (widget, &requisition, NULL);
+    #else
     gtk_widget_get_allocation (widget, &allocation);
     gtk_widget_size_request (widget, &requisition);
+    #endif
     *ax = floor (allocation.x + xpad
         + ((allocation.width - requisition.width) * xalign));
     *ay = floor (allocation.y + ypad