- 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);