[gtk+] inspector: Handle attribute mapping changes better



commit bb9bf4b40888da66129801313144ac3ad2129b04
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 30 21:47:40 2014 -0400

    inspector: Handle attribute mapping changes better
    
    When the mapping is changed, notify the property and
    queue a draw on the widget. This makes both the inspector
    and the app update their display.

 gtk/inspector/prop-editor.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index c90a114..f81d002 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -1073,6 +1073,17 @@ gtk_cell_layout_get_model (GtkCellLayout *layout)
     return NULL;
 }
 
+GtkWidget *
+gtk_cell_layout_get_widget (GtkCellLayout *layout)
+{
+  if (GTK_IS_TREE_VIEW_COLUMN (layout))
+    return gtk_tree_view_column_get_tree_view (GTK_TREE_VIEW_COLUMN (layout));
+  else if (GTK_IS_WIDGET (layout))
+    return GTK_WIDGET (layout);
+  else
+    return NULL;
+}
+
 static void
 model_properties (GtkButton              *button,
                   GtkInspectorPropEditor *editor)
@@ -1102,6 +1113,8 @@ attribute_mapping_changed (GtkComboBox            *combo,
       if (col != -1)
         gtk_cell_area_attribute_connect (area, cell, editor->priv->name, col);
       gtk_widget_set_sensitive (editor->priv->editor, col == -1);
+      notify_property (editor->priv->object, find_property (editor));
+      gtk_widget_queue_draw (gtk_cell_layout_get_widget (GTK_CELL_LAYOUT (layout)));
     }
 }
 


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