[gtk+/gtk-3-16] inspector: allow object read-only properties in prop-editor



commit 68e31e19feca04dec8ec7086fd3b4513acefc039
Author: Christian Hergert <christian hergert me>
Date:   Tue May 5 12:19:10 2015 -0700

    inspector: allow object read-only properties in prop-editor
    
    If we have a GObject property that is also a GObject, we should be able
    to view additional information on that object (even if the param spec
    is read-only).

 gtk/inspector/prop-editor.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index 8a28539..dd17bd4 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -1592,6 +1592,14 @@ constructed (GObject *object)
   can_modify = ((spec->flags & G_PARAM_WRITABLE) != 0 &&
                 (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0);
 
+  /*
+   * 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.
+   */
+  if (g_type_is_a (spec->value_type, G_TYPE_OBJECT))
+    can_modify = TRUE;
+
   if (!can_modify)
     return;
 


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