[gtk+] themingengine: Implement outline support



commit c15839f4bec8f4071c8bec02143519f0a949dbee
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 b09b8d4..124f2a8 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]