X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkspinner.c;h=06840c88fe441b6674fae97de6a8be4f074583c6;hb=3c04597306a918317cb96d6c267fc73a798c04e4;hp=8a5e36026225ea3151a513e20d461d3bcbfab432;hpb=e6251f0248f7626e6d10d27e64d54cd1010d6895;p=~andy%2Fgtk diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c index 8a5e36026..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,11 +29,12 @@ #include "config.h" -#include "gtkintl.h" -#include "gtkaccessible.h" -#include "gtkimage.h" #include "gtkspinner.h" -#include "a11y/gtkwidgetaccessible.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; }