[gtk+] Recorder: Show details of border nodes



commit 9e9df66b8180f348a5906daa3007e889cedfb292
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 28 18:58:18 2017 -0400

    Recorder: Show details of border nodes

 gtk/inspector/recorder.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 0da4f41..6b2d265 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -349,6 +349,34 @@ populate_render_node_properties (GtkListStore  *store,
       }
       break;
 
+    case GSK_BORDER_NODE:
+      {
+        const char *name[4] = { "Top", "Right", "Bottom", "Left" };
+        const float *widths = gsk_border_node_peek_widths (node);
+        const GdkRGBA *colors = gsk_border_node_peek_colors (node);
+        int i;
+
+        for (i = 0; i < 4; i++)
+          {
+            cairo_surface_t *surface;
+            char *text, *text2;
+
+            surface = get_color_surface (&colors[i]);
+            text = gdk_rgba_to_string (&colors[i]);
+            text2 = g_strdup_printf ("%.2f, %s", widths[i], text);
+            gtk_list_store_insert_with_values (store, NULL, -1,
+                                               0, name[i],
+                                               1, text2,
+                                               2, TRUE,
+                                               3, surface,
+                                               -1);
+            g_free (text);
+            g_free (text2);
+            cairo_surface_destroy (surface);
+          }
+      }
+      break;
+
     default: ;
     }
 }


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