mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 08:40:08 +00:00
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.
This commit is contained in:
parent
2e4c87038e
commit
bb9bf4b408
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user