1
0
mirror of https://github.com/irssi/irssi.git synced 2024-08-04 03:34:18 -04:00

Make sure there's always at least one column even if there's items

wider than max. width allows.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1320 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-03-03 21:01:18 +00:00 committed by cras
parent bc0069c02f
commit 1b8705bd44

View File

@ -638,6 +638,7 @@ int get_max_column_count(GSList *items, COLUMN_LEN_FUNC len_func,
} }
len = max_width/(item_extra+item_min_size); len = max_width/(item_extra+item_min_size);
if (len <= 0) len = 1;
if (max_columns <= 0 || len < max_columns) if (max_columns <= 0 || len < max_columns)
max_columns = len; max_columns = len;
@ -670,7 +671,7 @@ int get_max_column_count(GSList *items, COLUMN_LEN_FUNC len_func,
item_pos++; item_pos++;
} }
for (n = max_columns-1; n > 0; n--) { for (n = max_columns-1; n > 1; n--) {
if (columns_width[n] <= max_width && if (columns_width[n] <= max_width &&
columns[n][n] > 0) columns[n][n] > 0)
break; break;