mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 08:40:08 +00:00
inspector: Add cell areas into the tree
This commit is contained in:
parent
9467c56b94
commit
2af94dff1c
@ -186,6 +186,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
GtkInspectorWidgetTree *wt;
|
GtkInspectorWidgetTree *wt;
|
||||||
GtkTreeIter *iter;
|
GtkTreeIter *iter;
|
||||||
|
GObject *parent;
|
||||||
} FindAllData;
|
} FindAllData;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -196,6 +197,18 @@ on_container_forall (GtkWidget *widget,
|
|||||||
gtk_inspector_widget_tree_append_object (d->wt, G_OBJECT (widget), d->iter, NULL);
|
gtk_inspector_widget_tree_append_object (d->wt, G_OBJECT (widget), d->iter, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
cell_callback (GtkCellRenderer *renderer,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
FindAllData *d = data;
|
||||||
|
|
||||||
|
g_object_set_data (G_OBJECT (renderer), "gtk-inspector-cell-area", d->parent);
|
||||||
|
gtk_inspector_widget_tree_append_object (d->wt, G_OBJECT (renderer), d->iter, NULL);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
|
gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
|
||||||
GObject *object,
|
GObject *object,
|
||||||
@ -276,6 +289,7 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
|
|||||||
|
|
||||||
data.wt = wt;
|
data.wt = wt;
|
||||||
data.iter = &iter;
|
data.iter = &iter;
|
||||||
|
data.parent = object;
|
||||||
|
|
||||||
gtk_container_forall (GTK_CONTAINER (object), on_container_forall, &data);
|
gtk_container_forall (GTK_CONTAINER (object), on_container_forall, &data);
|
||||||
}
|
}
|
||||||
@ -293,21 +307,22 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GTK_IS_CELL_LAYOUT (object))
|
if (GTK_IS_CELL_AREA (object))
|
||||||
|
{
|
||||||
|
FindAllData data;
|
||||||
|
|
||||||
|
data.wt = wt;
|
||||||
|
data.iter = &iter;
|
||||||
|
data.parent = object;
|
||||||
|
|
||||||
|
gtk_cell_area_foreach (GTK_CELL_AREA (object), cell_callback, &data);
|
||||||
|
}
|
||||||
|
else if (GTK_IS_CELL_LAYOUT (object))
|
||||||
{
|
{
|
||||||
GList *cells, *l;
|
|
||||||
GObject *cell;
|
|
||||||
GtkCellArea *area;
|
GtkCellArea *area;
|
||||||
|
|
||||||
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (object));
|
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (object));
|
||||||
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (object));
|
gtk_inspector_widget_tree_append_object (wt, G_OBJECT (area), &iter, NULL);
|
||||||
for (l = cells; l; l = l->next)
|
|
||||||
{
|
|
||||||
cell = l->data;
|
|
||||||
g_object_set_data (cell, "gtk-inspector-cell-area", area);
|
|
||||||
gtk_inspector_widget_tree_append_object (wt, cell, &iter, NULL);
|
|
||||||
}
|
|
||||||
g_list_free (cells);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user