GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 3111ac0b authored by Benjamin Otte's avatar Benjamin Otte

tests: Make prop-editor use a grid instead of a table

parent 60eede3d
......@@ -1020,7 +1020,7 @@ properties_from_type (GObject *object,
GtkWidget *label;
GtkWidget *sw;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *grid;
GParamSpec **specs;
guint n_specs;
int i;
......@@ -1041,9 +1041,9 @@ properties_from_type (GObject *object,
return NULL;
}
table = gtk_table_new (n_specs, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
i = 0;
while (i < n_specs)
......@@ -1073,10 +1073,10 @@ properties_from_type (GObject *object,
label = gtk_label_new (g_param_spec_get_nick (spec));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
prop_edit = property_widget (object, spec, can_modify);
gtk_table_attach_defaults (GTK_TABLE (table), prop_edit, 1, 2, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
/* set initial value */
g_object_notify (object, spec->name);
......@@ -1086,7 +1086,7 @@ properties_from_type (GObject *object,
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
......@@ -1106,7 +1106,7 @@ child_properties_from_object (GObject *object)
GtkWidget *label;
GtkWidget *sw;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *grid;
GtkWidget *parent;
GParamSpec **specs;
guint n_specs;
......@@ -1122,9 +1122,9 @@ child_properties_from_object (GObject *object)
specs = gtk_container_class_list_child_properties (G_OBJECT_GET_CLASS (parent), &n_specs);
table = gtk_table_new (n_specs, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
i = 0;
while (i < n_specs)
......@@ -1147,11 +1147,11 @@ child_properties_from_object (GObject *object)
label = gtk_label_new (g_param_spec_get_nick (spec));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
mark_child_property (spec);
prop_edit = property_widget (object, spec, can_modify);
gtk_table_attach_defaults (GTK_TABLE (table), prop_edit, 1, 2, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
/* set initial value */
gtk_widget_child_notify (GTK_WIDGET (object), spec->name);
......@@ -1160,7 +1160,7 @@ child_properties_from_object (GObject *object)
}
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
......@@ -1184,7 +1184,7 @@ static GtkWidget *
children_from_object (GObject *object)
{
GList *children, *c;
GtkWidget *table, *label, *prop_edit, *button, *vbox, *sw;
GtkWidget *grid, *label, *prop_edit, *button, *vbox, *sw;
gchar *str;
gint i;
......@@ -1193,9 +1193,9 @@ children_from_object (GObject *object)
children = gtk_container_get_children (GTK_CONTAINER (object));
table = gtk_table_new (g_list_length (children), 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
for (c = children, i = 0; c; c = c->next, i++)
{
......@@ -1204,7 +1204,7 @@ children_from_object (GObject *object)
label = gtk_label_new ("Child");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
prop_edit = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
......@@ -1219,11 +1219,11 @@ children_from_object (GObject *object)
gtk_container_add (GTK_CONTAINER (prop_edit), label);
gtk_container_add (GTK_CONTAINER (prop_edit), button);
gtk_table_attach_defaults (GTK_TABLE (table), prop_edit, 1, 2, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
}
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
......@@ -1240,7 +1240,7 @@ static GtkWidget *
cells_from_object (GObject *object)
{
GList *cells, *c;
GtkWidget *table, *label, *prop_edit, *button, *vbox, *sw;
GtkWidget *grid, *label, *prop_edit, *button, *vbox, *sw;
gchar *str;
gint i;
......@@ -1249,9 +1249,9 @@ cells_from_object (GObject *object)
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (object));
table = gtk_table_new (g_list_length (cells), 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
for (c = cells, i = 0; c; c = c->next, i++)
{
......@@ -1260,7 +1260,7 @@ cells_from_object (GObject *object)
label = gtk_label_new ("Cell");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
prop_edit = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
......@@ -1275,11 +1275,11 @@ cells_from_object (GObject *object)
gtk_container_add (GTK_CONTAINER (prop_edit), label);
gtk_container_add (GTK_CONTAINER (prop_edit), button);
gtk_table_attach_defaults (GTK_TABLE (table), prop_edit, 1, 2, i, i + 1);
gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
}
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment