diff options
author | William Jon McCann <william.jon.mccann@gmail.com> | 2013-10-10 16:54:16 -0400 |
---|---|---|
committer | William Jon McCann <william.jon.mccann@gmail.com> | 2013-10-11 08:38:37 -0400 |
commit | b33877e1737a7799b29f5b3a3d291e55e95e8436 (patch) | |
tree | b0213f4288f285cd3d74ae8def2431c869abf7b8 /gtk/gtkspinner.c | |
parent | dd85acbaf17a1ffcd6c7dc8ee181e9c6cf771020 (diff) | |
download | gtk+-b33877e1737a7799b29f5b3a3d291e55e95e8436.tar.gz |
spinner: don't expand to fill the allocated space
Spinners are essentially animated symbolic icons. We don't really
want them being rendered to arbitrary sizes. Also the current
technique for rendering the activity is not suitable for larger
sizes. Until we have a better technique we should limit the size
to the MENU icon size or exactly twice that size.
Diffstat (limited to 'gtk/gtkspinner.c')
-rw-r--r-- | gtk/gtkspinner.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c index 50ae61341e..ec882b1add 100644 --- a/gtk/gtkspinner.c +++ b/gtk/gtkspinner.c @@ -52,7 +52,7 @@ */ -#define SPINNER_SIZE 12 +#define SPINNER_SIZE 16 enum { PROP_0, @@ -205,6 +205,12 @@ gtk_spinner_draw (GtkWidget *widget, height = gtk_widget_get_allocated_height (widget); size = MIN (width, height); + /* at most allow a double size spinner */ + if (size >= 3 * SPINNER_SIZE) + size = SPINNER_SIZE * 2; + else + size = SPINNER_SIZE; + gtk_render_activity (context, cr, (width - size) / 2, (height - size) / 2, |