[gtk+/wip/css: 165/167] themingengine: Implement outline support



commit a7694bd29c2abf51efff1a82792ed87ca4070a05
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jan 8 02:55:34 2012 +0100

    themingengine: Implement outline support

 gtk/gtkthemingengine.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 728e960..8caa204 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1794,6 +1794,29 @@ render_frame_internal (GtkThemingEngine *engine,
   _gtk_rounded_box_apply_border_radius (&border_box, engine, state, junction);
 
   render_border (cr, &border_box, &border, hidden_side, colors, border_style);
+
+  border_style[0] = g_value_get_enum (_gtk_theming_engine_peek_property (engine, "outline-style"));
+  if (border_style[0] != GTK_BORDER_STYLE_NONE)
+    {
+      int offset;
+
+      border_style[1] = border_style[2] = border_style[3] = border_style[0];
+      border.top = g_value_get_int (_gtk_theming_engine_peek_property (engine, "outline-width"));
+      border.left = border.right = border.bottom = border.top;
+      colors[0] = *(GdkRGBA *) g_value_get_boxed (_gtk_theming_engine_peek_property (engine, "outline-color"));
+      colors[3] = colors[2] = colors[1] = colors[0];
+      offset = g_value_get_int (_gtk_theming_engine_peek_property (engine, "outline-offset"));
+      
+      /* reinit box here - outlines don't have a border radius */
+      _gtk_rounded_box_init_rect (&border_box, x, y, width, height);
+      _gtk_rounded_box_shrink (&border_box,
+                               - border.top - offset,
+                               - border.right - offset,
+                               - border.left - offset,
+                               - border.bottom - offset);
+      
+      render_border (cr, &border_box, &border, hidden_side, colors, border_style);
+    }
 }
 
 static void



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