[gtk+/gtk-style-context: 499/540] GtkThemingEngine: Also render topright and bottomleft corners if junction sides say so



commit dd152dbc3a04f5d486c1291a87fe6052e13c5a33
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Nov 24 23:20:15 2010 +0100

    GtkThemingEngine: Also render topright and bottomleft corners if junction sides say so

 gtk/gtkthemingengine.c |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index e16dc03..63b27ba 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1682,27 +1682,32 @@ render_frame_internal (GtkThemingEngine *engine,
                                     junction);
       cairo_stroke (cr);
 
-      if (radius == 0 &&
-          border_width > 1)
+      if (border_width > 1)
         {
           /* overprint top/right and bottom/left corner
-           * triangles, to give the box a 3D-like appearance
+           * triangles if there are square corners there,
+           * to give the box a 3D-like appearance.
            */
+          cairo_save (cr);
+
           if (border_style == GTK_BORDER_STYLE_INSET)
             gdk_cairo_set_source_rgba (cr, &lighter);
           else
             gdk_cairo_set_source_rgba (cr, border_color);
 
-          cairo_save (cr);
-
           cairo_set_line_width (cr, 1);
 
-          _cairo_corner_triangle (cr,
-                                  x + width - border_width, y,
-                                  border_width);
-          _cairo_corner_triangle (cr,
-                                  x, y + height - border_width,
-                                  border_width);
+          if (radius == 0 ||
+              (junction & GTK_JUNCTION_CORNER_TOPRIGHT) != 0)
+            _cairo_corner_triangle (cr,
+                                    x + width - border_width, y,
+                                    border_width);
+
+          if (radius == 0 ||
+              (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT) != 0)
+            _cairo_corner_triangle (cr,
+                                    x, y + height - border_width,
+                                    border_width);
           cairo_stroke (cr);
           cairo_restore (cr);
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]