diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 5 | ||||
-rw-r--r-- | tests/testtreefocus.c | 18 |
3 files changed, 28 insertions, 0 deletions
@@ -1,5 +1,10 @@ 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> + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_init): initialize the inconsistent field in the private structure, (gtk_cell_renderer_toggle_class_init), diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8644c4995c..aac17f0f2b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,10 @@ 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> + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_init): initialize the inconsistent field in the private structure, (gtk_cell_renderer_toggle_class_init), diff --git a/tests/testtreefocus.c b/tests/testtreefocus.c index 924e4f75c0..d4fb5f76ab 100644 --- a/tests/testtreefocus.c +++ b/tests/testtreefocus.c @@ -319,6 +319,23 @@ dave_toggled (GtkCellRendererToggle *cell, 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 main (int argc, char *argv[]) { @@ -435,6 +452,7 @@ main (int argc, char *argv[]) "visible", VISIBLE_COLUMN, NULL); 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_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); |