From: <sa...@us...> - 2006-10-29 01:32:17
|
Revision: 17615 http://svn.sourceforge.net/gaim/?rev=17615&view=rev Author: sadrul Date: 2006-10-28 18:32:04 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Patch from Richard Nelson (wabz) to fix the blist-width, and do ellipsization in the trees. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/libgnt/gntbox.c trunk/console/libgnt/gnttree.c trunk/console/plugins/gnthistory.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-10-29 00:15:32 UTC (rev 17614) +++ trunk/console/gntblist.c 2006-10-29 01:32:04 UTC (rev 17615) @@ -1315,10 +1315,13 @@ } static void -size_changed_cb(GntWidget *w, int width, int height) +size_changed_cb(GntWidget *w, int wi, int h) { + int width, height; + gnt_widget_get_size(w, &width, &height); gaim_prefs_set_int(PREF_ROOT "/size/width", width); gaim_prefs_set_int(PREF_ROOT "/size/height", height); + gnt_tree_set_col_width(GNT_TREE(ggblist->tree), 0, width - 1); } static void @@ -1864,12 +1867,14 @@ ggblist->tree = gnt_tree_new(); GNT_WIDGET_SET_FLAGS(ggblist->tree, GNT_WIDGET_NO_BORDER); - gnt_tree_set_col_width(GNT_TREE(ggblist->tree), 0, 25); gnt_widget_set_size(ggblist->tree, gaim_prefs_get_int(PREF_ROOT "/size/width"), gaim_prefs_get_int(PREF_ROOT "/size/height")); gnt_widget_set_position(ggblist->window, gaim_prefs_get_int(PREF_ROOT "/position/x"), gaim_prefs_get_int(PREF_ROOT "/position/y")); + gnt_tree_set_col_width(GNT_TREE(ggblist->tree), 0, + gaim_prefs_get_int(PREF_ROOT "/size/width") - 1); + gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); ggblist->status = gnt_combo_box_new(); Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-10-29 00:15:32 UTC (rev 17614) +++ trunk/console/libgnt/gntbox.c 2006-10-29 01:32:04 UTC (rev 17615) @@ -704,6 +704,9 @@ GntWidget *wid; int width, height; + if (GNT_WIDGET(box)->parent != NULL) + return; + for (iter = box->list; iter; iter = iter->next) { GntWidget *w = iter->data; Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-10-29 00:15:32 UTC (rev 17614) +++ trunk/console/libgnt/gnttree.c 2006-10-29 01:32:04 UTC (rev 17615) @@ -200,6 +200,7 @@ const char *text; int len = gnt_util_onscreen_width(col->text, NULL); int fl = 0; + gboolean cut = FALSE; if (i == 0) { @@ -231,13 +232,20 @@ else g_string_append_c(string, '|'); - if (len > tree->columns[i].width) - { - len = tree->columns[i].width; + if (len > tree->columns[i].width) { + len = tree->columns[i].width - 1; + cut = TRUE; } - text = gnt_util_onscreen_width_to_pointer(col->text, len - fl, NULL); string = g_string_append_len(string, col->text, text - col->text); + if (cut) { /* ellipsis */ + if (gnt_ascii_only()) + g_string_append_c(string, '~'); + else + string = g_string_append(string, "\342\200\246"); + len++; + } + if (len < tree->columns[i].width && iter->next) g_string_append_printf(string, "%*s", tree->columns[i].width - len, ""); } @@ -339,7 +347,6 @@ if ((wr = gnt_util_onscreen_width(str, NULL)) > scrcol) { - /* XXX: ellipsize */ char *s = (char*)gnt_util_onscreen_width_to_pointer(str, scrcol, &wr); *s = '\0'; } Modified: trunk/console/plugins/gnthistory.c =================================================================== --- trunk/console/plugins/gnthistory.c 2006-10-29 00:15:32 UTC (rev 17614) +++ trunk/console/plugins/gnthistory.c 2006-10-29 01:32:04 UTC (rev 17615) @@ -21,7 +21,6 @@ /* Ripped from gtk/plugins/history.c */ #include "internal.h" -#include "gntgaim.h" #include "conversation.h" #include "debug.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |