[gtk+/wip/multiple-backgrounds: 15/15] themingengine: render pane-separator grip only if we have no bg-image



commit ab0ebda7791fc2cedeb3e673189820973a992f7a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon May 14 09:20:56 2012 -0400

    themingengine: render pane-separator grip only if we have no bg-image
    
    So that it's possible to implement this with an SVG asset if we want.

 gtk/gtkthemingengine.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 70254e3..75b3ccf 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -2347,6 +2347,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
   GtkJunctionSides sides;
   GtkThemingBackground bg;
   gint xx, yy;
+  gboolean has_image;
 
   cairo_save (cr);
   flags = gtk_theming_engine_get_state (engine);
@@ -2359,6 +2360,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
   color_shade (&bg_color, 1.3, &lighter);
 
   _gtk_theming_background_init (&bg, engine, x, y, width, height, sides);
+  has_image = _gtk_theming_background_has_background_image (&bg);
   _gtk_theming_background_render (&bg, cr);
 
   gtk_theming_engine_render_frame (engine, cr, x, y, width, height);
@@ -2612,12 +2614,15 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
     }
   else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PANE_SEPARATOR))
     {
-      if (width > height)
-        for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)
-          render_dot (cr, &lighter, &darker, xx, y + height / 2 - 1, 3);
-      else
-        for (yy = y + height / 2 - 15; yy <= y + height / 2 + 15; yy += 5)
-          render_dot (cr, &lighter, &darker, x + width / 2 - 1, yy, 3);
+      if (!has_image)
+        {
+          if (width > height)
+            for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)
+              render_dot (cr, &lighter, &darker, xx, y + height / 2 - 1, 3);
+          else
+            for (yy = y + height / 2 - 15; yy <= y + height / 2 + 15; yy += 5)
+              render_dot (cr, &lighter, &darker, x + width / 2 - 1, yy, 3);
+        }
     }
   else
     {



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