[gtk-theme-engine-clearlooks/gtk-style-context: 14/21] Handle frames on render_frame_gap()



commit 76f95f8aceb8954f228e33eba8bbb54f73b2d16c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 16 00:57:17 2010 +0100

    Handle frames on render_frame_gap()

 src/clearlooks_engine.c |   60 +++++++++++++---------------------------------
 1 files changed, 17 insertions(+), 43 deletions(-)
---
diff --git a/src/clearlooks_engine.c b/src/clearlooks_engine.c
index 4732485..cb7f45a 100644
--- a/src/clearlooks_engine.c
+++ b/src/clearlooks_engine.c
@@ -267,11 +267,15 @@ clearlooks_engine_render_frame_gap (GtkThemingEngine *engine,
 				    gdouble          xy0_gap,
 				    gdouble          xy1_gap)
 {
+	ClearlooksStyleFunctions  *style_functions;
+
 	GE_CAIRO_INIT
 
+	clearlooks_lookup_functions (CLEARLOOKS_ENGINE (engine),
+				     &style_functions, NULL);
+
 	if (gtk_theming_engine_has_class (engine, "notebook"))
 	{
-		ClearlooksStyleFunctions  *style_functions;
 		FrameParameters  frame;
 		gboolean start, end;
 		CairoColor *bg_color;
@@ -290,9 +294,6 @@ clearlooks_engine_render_frame_gap (GtkThemingEngine *engine,
 					"border-radius", &radius,
 					NULL);
 
-		clearlooks_lookup_functions (CLEARLOOKS_ENGINE (engine),
-					     &style_functions, NULL);
-
 #if 0
 		clearlooks_get_notebook_tab_position (widget, &start, &end);
 
@@ -356,6 +357,18 @@ clearlooks_engine_render_frame_gap (GtkThemingEngine *engine,
 
 		gdk_rgba_free ((GdkRGBA *) bg_color);
 	}
+	else if (gtk_theming_engine_has_class (engine, "frame"))
+	{
+		FrameParameters  frame;
+
+		frame.gap_side  = gap_side;
+		frame.gap_x     = xy0_gap;
+		frame.gap_width = xy1_gap - xy0_gap;
+		clearlooks_lookup_shade (engine, 5, (GdkRGBA *) &frame.border);
+
+		style_functions->draw_frame (cr, engine, &frame,
+					     x, y, width, height);
+	}
 	else
 	{
 		GTK_THEMING_ENGINE_CLASS (clearlooks_engine_parent_class)->render_frame_gap (engine, cr, x, y, width, height,
@@ -1200,45 +1213,6 @@ clearlooks_style_draw_hline (GtkStyle               *style,
 }
 
 static void
-clearlooks_style_draw_shadow_gap (DRAW_ARGS,
-                                  GtkPositionType gap_side,
-                                  gint            gap_x,
-                                  gint            gap_width)
-{
-	ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-	const ClearlooksColors *colors;
-
-	CHECK_ARGS
-
-	colors = &clearlooks_style->colors;
-
-	if (DETAIL ("frame"))
-	{
-		WidgetParameters params;
-		FrameParameters  frame;
-
-		frame.shadow    = shadow_type;
-		frame.gap_side  = gap_side;
-		frame.gap_x     = gap_x;
-		frame.gap_width = gap_width;
-		frame.border    = &colors->shade[5];
-
-		clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
-		params.corners = CR_CORNER_ALL;
-
-		STYLE_FUNCTION(draw_frame) (cr, colors, &params, &frame,
-		                            x, y, width, height);
-	}
-	else
-	{
-		GTK_STYLE_CLASS (clearlooks_style_parent_class)->draw_shadow_gap (style, cr, state_type, shadow_type,
-		                                          widget, detail, x, y, width, height,
-		                                          gap_side, gap_x, gap_width);
-	}
-}
-
-static void
 clearlooks_style_draw_resize_grip (GtkStyle       *style,
                                    cairo_t        *cr,
                                    GtkStateType    state_type,



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