# HG changeset patch # User Simon Jacquin # Date 1330457182 -3600 # Node ID a859ed648638579d03b8576135c875969b8cb558 # Parent 0d5ece2324c6fda03948be3242573cebdc10ae26# Parent fa6694a193ec92ecc3ed7dd7e4598fe37d25b3fd Replace the option « no_space_before_items » with « roster_no_leading_space ». diff -r fa6694a193ec -r a859ed648638 mcabber/mcabber/screen.c --- a/mcabber/mcabber/screen.c Thu Feb 09 14:21:36 2012 +0100 +++ b/mcabber/mcabber/screen.c Tue Feb 28 20:26:22 2012 +0100 @@ -127,6 +127,7 @@ static int chatmode; static int multimode; static char *multiline, *multimode_subj; +static int roster_no_leading_space; static bool Curses; static bool log_win_on_top; @@ -1544,6 +1545,8 @@ int chat_y_pos, chatstatus_y_pos, log_y_pos; int roster_x_pos, chat_x_pos; + roster_no_leading_space = settings_opt_get_int("roster_no_leading_space"); + Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT; requested_size = settings_opt_get_int("log_win_height"); if (requested_size > 0) { @@ -1943,6 +1946,8 @@ char status, pending; enum imstatus currentstatus = xmpp_getstatus(); int x_pos; + char *space; + int prefix_length; // We can reset update_roster update_roster = FALSE; @@ -1999,6 +2004,15 @@ else x_pos = 0; + space = g_new0(char, 2); + if (roster_no_leading_space) { + space[0] = '\0'; + prefix_length = 6; + } else { + space[0] = ' '; + prefix_length = 7; + } + name = g_new0(char, 4*Roster_Width); rline = g_new0(char, 4*Roster_Width+1); @@ -2089,8 +2103,8 @@ } } - if (Roster_Width > 7) - g_utf8_strncpy(name, buddy_getname(BUDDATA(buddy)), Roster_Width-7); + if (Roster_Width > prefix_length) + g_utf8_strncpy(name, buddy_getname(BUDDATA(buddy)), Roster_Width-prefix_length); else name[0] = 0; @@ -2106,16 +2120,16 @@ int group_count = 0; foreach_group_member(BUDDATA(buddy), increment_if_buddy_not_filtered, &group_count); - snprintf(rline, 4*Roster_Width, " %c+++ %s (%i)", pending, name, + snprintf(rline, 4*Roster_Width, "%s%c+++ %s (%i)", space, pending, name, group_count); /* Do not display the item count if there isn't enough space */ if (g_utf8_strlen(rline, 4*Roster_Width) >= Roster_Width) - snprintf(rline, 4*Roster_Width, " %c+++ %s", pending, name); + snprintf(rline, 4*Roster_Width, "%s%c+++ %s", space, pending, name); } else - snprintf(rline, 4*Roster_Width, " %c--- %s", pending, name); + snprintf(rline, 4*Roster_Width, "%s%c--- %s", space, pending, name); } else if (isspe) { - snprintf(rline, 4*Roster_Width, " %c%s", pending, name); + snprintf(rline, 4*Roster_Width, "%s%c%s", space, pending, name); } else { char sepleft = '['; char sepright = ']'; @@ -2128,9 +2142,8 @@ sepright = '}'; } } - snprintf(rline, 4*Roster_Width, - " %c%c%c%c %s", pending, sepleft, status, sepright, name); + "%s%c%c%c%c %s", space, pending, sepleft, status, sepright, name); } rline_locale = from_utf8(rline); @@ -2139,6 +2152,7 @@ i++; } + g_free(space); g_free(rline); g_free(name); top_panel(inputPanel); diff -r fa6694a193ec -r a859ed648638 mcabber/mcabberrc.example --- a/mcabber/mcabberrc.example Thu Feb 09 14:21:36 2012 +0100 +++ b/mcabber/mcabberrc.example Tue Feb 28 20:26:22 2012 +0100 @@ -129,6 +129,10 @@ # running you can use "/roster display"). #set roster_display_filter = ofdna_ +# By default, mcabber adds a leading space before each buddy in the roster. You +# can remove it to gain a little space. +#set roster_no_leading_space = 0 + # By default command line completion is case-sensitive; this can be changed # by setting the option 'completion_ignore_case' to 1. #set completion_ignore_case = 0