← Back to team overview

elementaryart team mailing list archive

[Merge] lp:~eyelash/granite/fix-1012845 into lp:granite

 

Elias has proposed merging lp:~eyelash/granite/fix-1012845 into lp:granite.

Requested reviews:
  elementary Pantheon team (elementary-pantheon)
Related bugs:
  Bug #1012845 in Granite: "Popover Border is now inside instead of outside"
  https://bugs.launchpad.net/granite/+bug/1012845

For more details, see:
https://code.launchpad.net/~eyelash/granite/fix-1012845/+merge/110668

The border is now drawn using Cairo.Operator.SOURCE which means the border has the exact colour you give it (if you set it to transparent it will be transparent). This is how it was before.
-- 
https://code.launchpad.net/~eyelash/granite/fix-1012845/+merge/110668
Your team elementaryart (old) is subscribed to branch lp:granite.
=== modified file 'lib/Widgets/PopOver.vala'
--- lib/Widgets/PopOver.vala	2012-06-10 14:43:10 +0000
+++ lib/Widgets/PopOver.vala	2012-06-16 21:23:19 +0000
@@ -360,8 +360,6 @@
 
     protected void cairo_popover (Cairo.Context cr, double x, double y, double width, double height, double border_radius) {
 
-        if (border_radius < 0.0) border_radius = 0.0;
-
         // The top half
         if (arrow_up) {
             cr.arc (x + border_radius, y + ARROW_HEIGHT + border_radius, border_radius, Math.PI, Math.PI * 1.5);
@@ -398,8 +396,8 @@
         main_buffer = new Granite.Drawing.BufferSurface (w, h);
 
         // Shadow first
-        cairo_popover (main_buffer.context, SHADOW_SIZE, SHADOW_SIZE,
-                       w - SHADOW_SIZE * 2, h - SHADOW_SIZE * 2, BORDER_RADIUS);
+        cairo_popover (main_buffer.context, SHADOW_SIZE + BORDER_WIDTH / 2.0, SHADOW_SIZE + BORDER_WIDTH / 2.0,
+                       w - SHADOW_SIZE * 2 - BORDER_WIDTH, h - SHADOW_SIZE * 2 - BORDER_WIDTH, BORDER_RADIUS);
         main_buffer.context.set_source_rgba (0.0, 0.0, 0.0, 0.4);
         main_buffer.context.fill_preserve ();
         main_buffer.exponential_blur (SHADOW_SIZE / 2 - 1); // rough approximation
@@ -417,7 +415,8 @@
         // Outer border
         main_buffer.context.reset_clip ();
         cairo_popover (main_buffer.context, SHADOW_SIZE + BORDER_WIDTH / 2.0, SHADOW_SIZE + BORDER_WIDTH / 2.0,
-                       w - SHADOW_SIZE * 2 - BORDER_WIDTH, h - SHADOW_SIZE * 2 - BORDER_WIDTH, BORDER_RADIUS - BORDER_WIDTH / 2.0);
+                       w - SHADOW_SIZE * 2 - BORDER_WIDTH, h - SHADOW_SIZE * 2 - BORDER_WIDTH, BORDER_RADIUS);
+        main_buffer.context.set_operator (Cairo.Operator.SOURCE);
         main_buffer.context.set_line_width (BORDER_WIDTH);
         Gdk.cairo_set_source_rgba (main_buffer.context, get_style_context ().get_border_color (Gtk.StateFlags.NORMAL));
         main_buffer.context.stroke ();


Follow ups