From 93c79d44637ebfe1061073ef838289b3bf026b37 Mon Sep 17 00:00:00 2001 From: TingPing Date: Sat, 23 Mar 2013 04:28:22 -0300 Subject: [PATCH] fix tree indentation with icons --- src/fe-gtk/chanview-tree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c index 216ba89f..2a0bff65 100644 --- a/src/fe-gtk/chanview-tree.c +++ b/src/fe-gtk/chanview-tree.c @@ -75,6 +75,7 @@ cv_tree_init (chanview *cv) { GtkWidget *view, *win; GtkCellRenderer *renderer; + GtkTreeViewColumn *col; int wid1, wid2; static const GtkTargetEntry dnd_src_target[] = { @@ -116,6 +117,7 @@ cv_tree_init (chanview *cv) gtk_container_add (GTK_CONTAINER (win), view); + col = gtk_tree_view_column_new(); /* icon column */ if (cv->use_icons) @@ -123,9 +125,9 @@ cv_tree_init (chanview *cv) renderer = gtk_cell_renderer_pixbuf_new (); if (prefs.hex_gui_compact) g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), - -1, NULL, renderer, - "pixbuf", COL_PIXBUF, NULL); + + gtk_tree_view_column_pack_start(col, renderer, FALSE); + gtk_tree_view_column_set_attributes (col, renderer, "pixbuf", COL_PIXBUF, NULL); } /* main column */ @@ -133,9 +135,9 @@ cv_tree_init (chanview *cv) if (prefs.hex_gui_compact) g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), - -1, NULL, renderer, - "text", COL_NAME, "attributes", COL_ATTR, NULL); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_set_attributes (col, renderer, "text", COL_NAME, "attributes", COL_ATTR, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), col); g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (view))), "changed", G_CALLBACK (cv_tree_sel_cb), cv);