add a little test for the newly introduced indicator-size property.

2006-01-13  Kristian Rietveld  <kris@imendio.com>

	* tests/testtreefocus.c (set_indicator_size), (main): add a little
	test for the newly introduced indicator-size property.
This commit is contained in:
Kristian Rietveld 2006-01-13 13:28:22 +00:00 committed by Kristian Rietveld
parent ce5e74e1fe
commit 22870aa96d
3 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-01-13 Kristian Rietveld <kris@imendio.com>
* tests/testtreefocus.c (set_indicator_size), (main): add a little
test for the newly introduced indicator-size property.
2006-01-13 Kristian Rietveld <kris@imendio.com> 2006-01-13 Kristian Rietveld <kris@imendio.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_init): * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_init):

View File

@ -1,3 +1,8 @@
2006-01-13 Kristian Rietveld <kris@imendio.com>
* tests/testtreefocus.c (set_indicator_size), (main): add a little
test for the newly introduced indicator-size property.
2006-01-13 Kristian Rietveld <kris@imendio.com> 2006-01-13 Kristian Rietveld <kris@imendio.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_init): * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_init):

View File

@ -319,6 +319,23 @@ dave_toggled (GtkCellRendererToggle *cell,
gtk_tree_path_free (path); gtk_tree_path_free (path);
} }
static void
set_indicator_size (GtkTreeViewColumn *column,
GtkCellRenderer *cell,
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gint size;
GtkTreePath *path;
path = gtk_tree_model_get_path (model, iter);
size = gtk_tree_path_get_indices (path)[0] * 2 + 10;
gtk_tree_path_free (path);
g_object_set (cell, "indicator_size", size, NULL);
}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
@ -435,6 +452,7 @@ main (int argc, char *argv[])
"visible", VISIBLE_COLUMN, "visible", VISIBLE_COLUMN,
NULL); NULL);
column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), col_offset - 1); column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), col_offset - 1);
gtk_tree_view_column_set_cell_data_func (column, renderer, set_indicator_size, NULL, NULL);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);