Implement radial gradients for StWidget
Some theme authors have stated interest in radial gradient backgrounds. The w3c has some draft: http://dev.w3.org/csswg/css3-images/#radial-gradients As this is rather complex, we add only some very basic support, which extends our syntax for linear gradients: background-gradient-direction: [vertical|horizontal|radial] Gradients are centered circles, whose size is determined by the closest side. https://bugzilla.gnome.org/show_bug.cgi?id=604945
This commit is contained in:
@ -632,8 +632,16 @@ st_widget_redraw_gradient (StWidget *widget)
|
||||
|
||||
if (priv->bg_gradient_type == ST_GRADIENT_VERTICAL)
|
||||
pattern = cairo_pattern_create_linear (0, 0, 0, height);
|
||||
else
|
||||
else if (priv->bg_gradient_type == ST_GRADIENT_HORIZONTAL)
|
||||
pattern = cairo_pattern_create_linear (0, 0, width, 0);
|
||||
else
|
||||
{
|
||||
gdouble cx, cy;
|
||||
|
||||
cx = width / 2.;
|
||||
cy = height / 2.;
|
||||
pattern = cairo_pattern_create_radial (cx, cy, 0, cx, cy, MIN (cx, cy));
|
||||
}
|
||||
|
||||
cairo_pattern_add_color_stop_rgba (pattern, 0,
|
||||
start->red / 255.,
|
||||
|
Reference in New Issue
Block a user