summaryrefslogtreecommitdiff
path: root/gtk/gtkspinner.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-09-17 22:47:36 -0400
committerMatthias Clasen <mclasen@redhat.com>2012-09-17 22:47:36 -0400
commitbf2cf23262df3557f811bc2c99948bd73d455d76 (patch)
tree38508a1eb6e705339d3a2a43bb392f52b85e9e45 /gtk/gtkspinner.c
parent6210e7fb80b2cacaf3960cec62c00c602d29f529 (diff)
downloadgtk+-bf2cf23262df3557f811bc2c99948bd73d455d76.tar.gz
Force spinners to be square
Diffstat (limited to 'gtk/gtkspinner.c')
-rw-r--r--gtk/gtkspinner.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index 532ed07b33..06840c88fe 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -201,12 +201,19 @@ gtk_spinner_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkStyleContext *context;
+ gint width, height;
+ gint size;
context = gtk_widget_get_style_context (widget);
- 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;
}