Revision 2c65471fa441207442778d71677b107f6e932b95

sadrul at pidgin.im sadrul at pidgin.im
Sat Mar 31 23:49:48 EDT 2007


o   -----------------------------------------------------------------
|   Revision: 2c65471fa441207442778d71677b107f6e932b95
|   Ancestor: 1370ba94afc8d4c4413b3887e5f31622dd02e8be
|   Author: sadrul at pidgin.im
|   Date: 2007-03-30T06:47:54
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           finch/libgnt/gnttree.c
|   
|   ChangeLog: 
|   
|   Fine tune column hiding.
|   
|   ============================================================
|   --- finch/libgnt/gnttree.c	51c46e82f4470a67b577a42df252f182ee1fffd2
|   +++ finch/libgnt/gnttree.c	b4770c2e891604b038ebc559e843e06b994cf7cf
|   @@ -223,7 +223,11 @@ update_row_text(GntTree *tree, GntTreeRo
|    	GList *iter;
|    	int i;
|    	gboolean notfirst = FALSE;
|   +	int lastvisible = tree->ncol;
|    
|   +	while (lastvisible && tree->columns[lastvisible].invisible)
|   +		lastvisible--;
|   +
|    	for (i = 0, iter = row->columns; i < tree->ncol && iter; i++, iter = iter->next)
|    	{
|    		GntTreeCol *col = iter->data;
|   @@ -231,10 +235,16 @@ update_row_text(GntTree *tree, GntTreeRo
|    		int len = gnt_util_onscreen_width(col->text, NULL);
|    		int fl = 0;
|    		gboolean cut = FALSE;
|   +		int width;
|    
|    		if (tree->columns[i].invisible)
|    			continue;
|    
|   +		if (i == lastvisible)
|   +			width = GNT_WIDGET(tree)->priv.width - gnt_util_onscreen_width(string->str, NULL);
|   +		else
|   +			width = tree->columns[i].width;
|   +
|    		if (i == 0)
|    		{
|    			if (row->choice)
|   @@ -269,8 +279,8 @@ update_row_text(GntTree *tree, GntTreeRo
|    
|    		notfirst = TRUE;
|    
|   -		if (len > tree->columns[i].width) {
|   -			len = tree->columns[i].width - 1;
|   +		if (len > width) {
|   +			len = width - 1;
|    			cut = TRUE;
|    		}
|    		text = gnt_util_onscreen_width_to_pointer(col->text, len - fl, NULL);
|   @@ -284,7 +294,7 @@ update_row_text(GntTree *tree, GntTreeRo
|    		}
|    
|    		if (len < tree->columns[i].width && iter->next)
|   -			g_string_append_printf(string, "%*s", tree->columns[i].width - len, "");
|   +			g_string_append_printf(string, "%*s", width - len, "");
|    	}
|    	return g_string_free(string, FALSE);
|    }

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from 2c65471fa441207442778d71677b107f6e932b95


More information about the Commits mailing list