diff options
author | Benjamin Otte <otte@redhat.com> | 2015-01-19 17:41:29 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-01-20 06:30:19 +0100 |
commit | e697213b35e6fe2bf1bea6b6d51607c1a7241bc1 (patch) | |
tree | 0cca1a4426f4777c2b9b0239f4fbd57ba966b93c /gtk/gtkrender.c | |
parent | cc4d34e6884b958505dfd888d9b53b4b39084581 (diff) | |
download | gtk+-e697213b35e6fe2bf1bea6b6d51607c1a7241bc1.tar.gz |
render: Remove spinner special-cases
The spinner is a regular builtin image now. There is no need to go
through the shadows code manually anymore as regular items do get
shadows automatically.
This also allows simplifying the actual spinner drawing code so that it
actually works.
Diffstat (limited to 'gtk/gtkrender.c')
-rw-r--r-- | gtk/gtkrender.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c index 133ba2fd29..d5d3ad10b8 100644 --- a/gtk/gtkrender.c +++ b/gtk/gtkrender.c @@ -1042,56 +1042,6 @@ gtk_render_handle (GtkStyleContext *context, cairo_restore (cr); } -void -gtk_render_paint_spinner (cairo_t *cr, - gdouble radius, - gdouble progress) -{ - guint num_steps, step; - gdouble half; - gint i; - - num_steps = 12; - - if (progress >= 0) - step = (guint) (progress * num_steps); - else - step = 0; - - cairo_save (cr); - - cairo_set_operator (cr, CAIRO_OPERATOR_OVER); - cairo_set_line_width (cr, 2.0); - - half = num_steps / 2; - - for (i = 0; i < num_steps; i++) - { - gint inset = 0.7 * radius; - - /* transparency is a function of time and intial value */ - gdouble t = 1.0 - (gdouble) ((i + step) % num_steps) / num_steps; - gdouble xscale = - sin (i * G_PI / half); - gdouble yscale = - cos (i * G_PI / half); - - cairo_push_group (cr); - - cairo_move_to (cr, - (radius - inset) * xscale, - (radius - inset) * yscale); - cairo_line_to (cr, - radius * xscale, - radius * yscale); - - cairo_stroke (cr); - - cairo_pop_group_to_source (cr); - cairo_paint_with_alpha (cr, t); - } - - cairo_restore (cr); -} - /** * gtk_render_activity: * @context: a #GtkStyleContext |