X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkspinner.c;h=06840c88fe441b6674fae97de6a8be4f074583c6;hb=9f41970832b60f3cf6644dfbd154df7ec24f26ce;hp=e495603b0a07a9b8e7e05cf010c31791adae4341;hpb=52711beba57239aadde460d49d492ef6951f9335;p=~andy%2Fgtk diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c index e495603b0..06840c88f 100644 --- a/gtk/gtkspinner.c +++ b/gtk/gtkspinner.c @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . * * Code adapted from egg-spinner * by Christian Hergert @@ -31,10 +29,11 @@ #include "config.h" -#include "gtkintl.h" -#include "gtkaccessible.h" -#include "gtkimage.h" #include "gtkspinner.h" + +#include "gtkimage.h" +#include "gtkintl.h" +#include "gtkstylecontext.h" #include "a11y/gtkspinneraccessible.h" @@ -202,15 +201,19 @@ gtk_spinner_draw (GtkWidget *widget, cairo_t *cr) { GtkStyleContext *context; - GtkStateFlags state; + gint width, height; + gint size; context = gtk_widget_get_style_context (widget); - state = gtk_widget_get_state_flags (widget); - gtk_style_context_set_state (context, state); - gtk_render_activity (context, cr, 0, 0, - gtk_widget_get_allocated_width (widget), - gtk_widget_get_allocated_height (widget)); + width = gtk_widget_get_allocated_width (widget); + height = gtk_widget_get_allocated_height (widget); + size = MIN (width, height); + + gtk_render_activity (context, cr, + (width - size) / 2, + (height - size) / 2, + size, size); return FALSE; }