[gtk+] gadget: Show layout



commit ad5469759493734b0cd4e6a8b710c3d3da6119bb
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 10 23:13:54 2016 -0500

    gadget: Show layout
    
    When the layout debug key is set, overlay boxes for the content
    and border area of each gadget.

 gtk/gtkcssgadget.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index 48d1da1..a739a15 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -887,6 +887,28 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
                                   height - margin.top - margin.bottom);
 
 #if G_ENABLE_DEBUG
+  if (GTK_DEBUG_CHECK (LAYOUT))
+    {
+      cairo_save (cr);
+      cairo_new_path (cr);
+      cairo_rectangle (cr,
+                       x + margin.left,
+                       y + margin.top,
+                       width - margin.left - margin.right,
+                       height - margin.top - margin.bottom);
+      cairo_set_line_width (cr, 1.0);
+      cairo_set_source_rgba (cr, 0, 0, 1.0, 0.33);
+      cairo_stroke (cr);
+      cairo_rectangle (cr,
+                       contents_x,
+                       contents_y,
+                       contents_width,
+                       contents_height);
+      cairo_set_line_width (cr, 1.0);
+      cairo_set_source_rgba (cr, 1.0, 0, 1.0, 0.33);
+      cairo_stroke (cr);
+      cairo_restore (cr);
+    }
   if (GTK_DEBUG_CHECK (BASELINES))
     {
       int baseline = priv->allocated_baseline;


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