diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c index 1f1bca896d..03debe0344 100644 --- a/gtk/inspector/prop-editor.c +++ b/gtk/inspector/prop-editor.c @@ -1712,6 +1712,20 @@ constructed (GObject *object) can_modify = ((spec->flags & G_PARAM_WRITABLE) != 0 && (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0); + if ((spec->flags & G_PARAM_CONSTRUCT_ONLY) != 0) + label = gtk_label_new ("(construct-only)"); + else if ((spec->flags & G_PARAM_WRITABLE) == 0) + label = gtk_label_new ("(not writable)"); + else + label = NULL; + + if (label) + { + gtk_widget_show (label); + gtk_style_context_add_class (gtk_widget_get_style_context (label), GTK_STYLE_CLASS_DIM_LABEL); + gtk_container_add (GTK_CONTAINER (editor), label); + } + /* By reaching this, we already know the property is readable. * Since all we can do for a GObject is dive down into it's properties * and inspect bindings and such, pretend to be mutable. diff --git a/gtk/inspector/prop-list.c b/gtk/inspector/prop-list.c index c02ba56ef6..e94644429d 100644 --- a/gtk/inspector/prop-list.c +++ b/gtk/inspector/prop-list.c @@ -412,6 +412,7 @@ gtk_inspector_prop_list_update_prop (GtkInspectorPropList *pl, gchar *value; gchar *type; gchar *attribute = NULL; + gboolean writable; g_value_init (&gvalue, prop->value_type); if (pl->priv->child_properties) @@ -447,13 +448,16 @@ gtk_inspector_prop_list_update_prop (GtkInspectorPropList *pl, attribute = g_strdup_printf ("%d", column); } + writable = ((prop->flags & G_PARAM_WRITABLE) != 0) && + ((prop->flags & G_PARAM_CONSTRUCT_ONLY) == 0); + gtk_list_store_set (pl->priv->model, iter, COLUMN_NAME, prop->name, COLUMN_VALUE, value ? value : "", COLUMN_TYPE, type ? type : "", COLUMN_DEFINED_AT, g_type_name (prop->owner_type), COLUMN_TOOLTIP, g_param_spec_get_blurb (prop), - COLUMN_WRITABLE, (prop->flags & G_PARAM_WRITABLE) != 0, + COLUMN_WRITABLE, writable, COLUMN_ATTRIBUTE, attribute ? attribute : "", -1);