fix tree indentation with icons

This commit is contained in:
TingPing 2013-03-23 04:28:22 -03:00
parent cd1155b83c
commit 93c79d4463

View File

@ -75,6 +75,7 @@ cv_tree_init (chanview *cv)
{ {
GtkWidget *view, *win; GtkWidget *view, *win;
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
GtkTreeViewColumn *col;
int wid1, wid2; int wid1, wid2;
static const GtkTargetEntry dnd_src_target[] = static const GtkTargetEntry dnd_src_target[] =
{ {
@ -116,6 +117,7 @@ cv_tree_init (chanview *cv)
gtk_container_add (GTK_CONTAINER (win), view); gtk_container_add (GTK_CONTAINER (win), view);
col = gtk_tree_view_column_new();
/* icon column */ /* icon column */
if (cv->use_icons) if (cv->use_icons)
@ -123,9 +125,9 @@ cv_tree_init (chanview *cv)
renderer = gtk_cell_renderer_pixbuf_new (); renderer = gtk_cell_renderer_pixbuf_new ();
if (prefs.hex_gui_compact) if (prefs.hex_gui_compact)
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),
-1, NULL, renderer, gtk_tree_view_column_pack_start(col, renderer, FALSE);
"pixbuf", COL_PIXBUF, NULL); gtk_tree_view_column_set_attributes (col, renderer, "pixbuf", COL_PIXBUF, NULL);
} }
/* main column */ /* main column */
@ -133,9 +135,9 @@ cv_tree_init (chanview *cv)
if (prefs.hex_gui_compact) if (prefs.hex_gui_compact)
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); 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_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), gtk_tree_view_column_pack_start(col, renderer, TRUE);
-1, NULL, renderer, gtk_tree_view_column_set_attributes (col, renderer, "text", COL_NAME, "attributes", COL_ATTR, NULL);
"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))), g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (view))),
"changed", G_CALLBACK (cv_tree_sel_cb), cv); "changed", G_CALLBACK (cv_tree_sel_cb), cv);