try to fix drawing

This commit is contained in:
Daniel Foré 2014-07-18 16:47:51 -07:00
parent 8e02d3f552
commit 7cbba07691

View File

@ -313,26 +313,31 @@ namespace Gala.Plugins.Notify
var buffer = new Granite.Drawing.BufferSurface (canvas.width, canvas.height);
var cr = buffer.context;
Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, x, y, width, height, 5);
Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, x - 0.5 , y - 0.5, width + 1, height + 1, 4);
cr.set_source_rgba (0, 0, 0, 0.6);
cr.set_source_rgba (0, 0, 0, 0.3);
cr.fill_preserve ();
buffer.exponential_blur (6);
cr.set_source_rgba (0, 0, 0, 0.1);
cr.set_source_rgba (0, 0, 0, 0.3);
cr.set_line_width (1);
cr.stroke ();
cr.stroke_preserve ();
Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, x + 1, y + 1, width - 2, height - 2, 5);
Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, x, y, width, height, 4);
cr.set_source_rgb (0.945, 0.945, 0.945);
cr.fill_preserve ();
cr.set_source_rgba (0, 0, 0, 0.0);
cr.stroke_preserve ();
var gradient = new Cairo.Pattern.linear (0, 0, 0, height - 2);
gradient.add_color_stop_rgba (0, 1, 1, 1, 1.0);
gradient.add_color_stop_rgba (1, 1, 1, 1, 0.6);
// var gradient = new Cairo.Pattern.linear (0, 0, 0, height - 2);
// gradient.add_color_stop_rgba (0, 1, 1, 1, 1.0);
// gradient.add_color_stop_rgba (1, 1, 1, 1, 0.6);
// cr.set_source (gradient);
cr.set_source (gradient);
cr.stroke ();
Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, 3);
cr.set_source_rgba (1, 0, 0, 0.3);
cr.set_line_width (1);
cr.stroke_preserve ();
// TODO move buffer out and optimize content drawing
draw_content (cr);
@ -347,4 +352,4 @@ namespace Gala.Plugins.Notify
return false;
}
}
}
}