inspector: Add inscription support
authorBenjamin Otte <otte@redhat.com>
Tue, 7 Jun 2022 15:30:14 +0000 (17:30 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 10 Jun 2022 02:34:23 +0000 (04:34 +0200)
Allow searching for inscription text and show it in the label column.

gtk/inspector/object-tree.c

index 9e88e19f62ebeada5ea77eef75020eef1c045866..34a740668351dec59aba85c7ef65d20410be9e38 100644 (file)
@@ -836,6 +836,8 @@ match_object (GObject    *object,
 
   if (GTK_IS_LABEL (object))
     return match_string (gtk_label_get_label (GTK_LABEL (object)), text);
+  if (GTK_IS_INSCRIPTION (object))
+    return match_string (gtk_inscription_get_text (GTK_INSCRIPTION (object)), text);
   else if (GTK_IS_BUTTON (object))
     return match_string (gtk_button_get_label (GTK_BUTTON (object)), text);
   else if (GTK_IS_WINDOW (object))
@@ -1086,6 +1088,8 @@ bind_label_cb (GtkSignalListItemFactory *factory,
 
   if (GTK_IS_LABEL (item))
     binding = g_object_bind_property (item, "label", inscription, "text", G_BINDING_SYNC_CREATE);
+  if (GTK_IS_INSCRIPTION (item))
+    binding = g_object_bind_property (item, "text", inscription, "text", G_BINDING_SYNC_CREATE);
   else if (GTK_IS_BUTTON (item))
     binding = g_object_bind_property (item, "label", inscription, "text", G_BINDING_SYNC_CREATE);
   else if (GTK_IS_WINDOW (item))