# HG changeset patch # User Sadrul Habib Chowdhury # Date 1213039940 0 # Node ID 6d4e4a5963f3c6dd2c0ccce6bb24c83a0604b51c # Parent 3cc64898bdbde2aade91a24d62de08c12cc1719b Fix an off-by-one bug in calculating column widths in trees. diff -r 3cc64898bdbd -r 6d4e4a5963f3 finch/gntblist.c --- a/finch/gntblist.c Mon Jun 09 19:31:43 2008 +0000 +++ b/finch/gntblist.c Mon Jun 09 19:32:20 2008 +0000 @@ -3033,9 +3033,6 @@ gnt_widget_set_position(ggblist->window, purple_prefs_get_int(PREF_ROOT "/position/x"), purple_prefs_get_int(PREF_ROOT "/position/y")); - gnt_tree_set_col_width(GNT_TREE(ggblist->tree), 0, - purple_prefs_get_int(PREF_ROOT "/size/width") - 1); - gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); ggblist->status = gnt_combo_box_new(); diff -r 3cc64898bdbd -r 6d4e4a5963f3 finch/libgnt/gnttree.c --- a/finch/libgnt/gnttree.c Mon Jun 09 19:31:43 2008 +0000 +++ b/finch/libgnt/gnttree.c Mon Jun 09 19:32:20 2008 +0000 @@ -110,13 +110,14 @@ gnt_widget_get_size(GNT_WIDGET(tree), &width, NULL); if (!GNT_WIDGET_IS_FLAG_SET(GNT_WIDGET(tree), GNT_WIDGET_NO_BORDER)) width -= 2; + width -= 1; /* Exclude the scrollbar from the calculation */ for (i = 0, total = 0; i < tree->ncol ; i++) { if (tree->columns[i].flags & GNT_TREE_COLUMN_INVISIBLE) continue; if (tree->columns[i].flags & GNT_TREE_COLUMN_FIXED_SIZE) - width -= WIDTH(i) + 1; + width -= WIDTH(i) + (tree->priv->lastvisible != i); else - total += WIDTH(i) + 1; + total += WIDTH(i) + (tree->priv->lastvisible != i); } if (total == 0)