[gtk+/gtk-style-context: 130/260] GtkThemingEngine: Cairo-ify frame_gap rendering from GtkStyle.



commit 2bce1b06e92d0fafb6a29c4ae83c94e4a9be44fc
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 19 11:58:13 2010 +0200

    GtkThemingEngine: Cairo-ify frame_gap rendering from GtkStyle.

 gtk/gtkthemingengine.c |   53 +++++++++++++++++++++++++----------------------
 1 files changed, 28 insertions(+), 25 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 8e74a03..b974b45 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1372,29 +1372,30 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
   else
     sides = SIDE_BOTTOM | SIDE_RIGHT;
 
-  if (gap_side == GTK_POS_RIGHT ||
-      gap_side == GTK_POS_BOTTOM)
-    add_path_gap_side (cr, gap_side, 0,
-                       x, y, width, height,
-                       xy0_gap, xy1_gap);
-
-  add_path_rounded_rectangle (cr, 0, sides,
-                              x, y, width, height);
+  gdk_cairo_set_source_color (cr, &darker);
+  add_path_rectangle_sides (cr, x + 1, y, width - 2, height, sides);
+  add_path_rectangle_sides (cr, x, y + 1, width, height - 2, sides);
+  cairo_stroke (cr);
 
   cairo_set_source_rgb (cr, 0, 0, 0);
+  add_path_rectangle_sides (cr, x, y, width, height, sides);
   cairo_stroke (cr);
 
   if (gap_side == GTK_POS_RIGHT ||
       gap_side == GTK_POS_BOTTOM)
-    add_path_gap_side (cr, gap_side, 0,
-                       x, y, width, height,
-                       xy0_gap, xy1_gap);
-
-  add_path_rounded_rectangle (cr, 0, sides,
-                              x, y, width - 1, height - 1);
+    {
+      gdk_cairo_set_source_color (cr, &darker);
+      add_path_gap_side (cr, gap_side,
+                         x, y, width - 2, height - 2,
+                         xy0_gap, xy1_gap);
+      cairo_stroke (cr);
 
-  gdk_cairo_set_source_color (cr, &darker);
-  cairo_stroke (cr);
+      cairo_set_source_rgb (cr, 0, 0, 0);
+      add_path_gap_side (cr, gap_side,
+                         x, y, width - 1, height - 1,
+                         xy0_gap, xy1_gap);
+      cairo_stroke (cr);
+    }
 
   if (gap_side == GTK_POS_LEFT)
     sides = SIDE_TOP;
@@ -1403,18 +1404,20 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
   else
     sides = SIDE_TOP | SIDE_LEFT;
 
-  if (gap_side == GTK_POS_TOP ||
-      gap_side == GTK_POS_LEFT)
-    add_path_gap_side (cr, gap_side, 0,
-                       x, y, width, height,
-                       xy0_gap, xy1_gap);
-
-  add_path_rounded_rectangle (cr, 0, sides,
-                              x, y, width, height);
-
   gdk_cairo_set_source_color (cr, &lighter);
+
+  add_path_rectangle_sides (cr, x, y, width, height, sides);
   cairo_stroke (cr);
 
+  if (gap_side == GTK_POS_LEFT ||
+      gap_side == GTK_POS_TOP)
+    {
+      add_path_gap_side (cr, gap_side,
+                         x, y, width, height,
+                         xy0_gap, xy1_gap);
+      cairo_stroke (cr);
+    }
+
   cairo_restore (cr);
 
   gdk_color_free (bg_color);



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