Fossil SCM
Vary the number of columns of displayed files in the File List depending on the length of the longest filename in the list.
Commit
ee723ed98ddb0a712da0521b0a0df1b64ddbd741
Parent
a52287876c414de…
1 file changed
+3
-1
+3
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -249,11 +249,13 @@ | ||
| 249 | 249 | /* Generate a multi-column table listing the contents of zD[] |
| 250 | 250 | ** directory. |
| 251 | 251 | */ |
| 252 | 252 | mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/"); |
| 253 | 253 | cnt = db_int(0, "SELECT count(*) FROM localfiles /*scan*/"); |
| 254 | - nCol = 4; | |
| 254 | + nCol = 100/mxLen; | |
| 255 | + if( nCol<1 ) nCol = 1; | |
| 256 | + if( nCol>5 ) nCol = 5; | |
| 255 | 257 | nRow = (cnt+nCol-1)/nCol; |
| 256 | 258 | db_prepare(&q, "SELECT x, u FROM localfiles ORDER BY x /*scan*/"); |
| 257 | 259 | @ <table class="browser"><tr><td class="browser"><ul class="browser"> |
| 258 | 260 | i = 0; |
| 259 | 261 | while( db_step(&q)==SQLITE_ROW ){ |
| 260 | 262 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -249,11 +249,13 @@ | |
| 249 | /* Generate a multi-column table listing the contents of zD[] |
| 250 | ** directory. |
| 251 | */ |
| 252 | mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/"); |
| 253 | cnt = db_int(0, "SELECT count(*) FROM localfiles /*scan*/"); |
| 254 | nCol = 4; |
| 255 | nRow = (cnt+nCol-1)/nCol; |
| 256 | db_prepare(&q, "SELECT x, u FROM localfiles ORDER BY x /*scan*/"); |
| 257 | @ <table class="browser"><tr><td class="browser"><ul class="browser"> |
| 258 | i = 0; |
| 259 | while( db_step(&q)==SQLITE_ROW ){ |
| 260 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -249,11 +249,13 @@ | |
| 249 | /* Generate a multi-column table listing the contents of zD[] |
| 250 | ** directory. |
| 251 | */ |
| 252 | mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/"); |
| 253 | cnt = db_int(0, "SELECT count(*) FROM localfiles /*scan*/"); |
| 254 | nCol = 100/mxLen; |
| 255 | if( nCol<1 ) nCol = 1; |
| 256 | if( nCol>5 ) nCol = 5; |
| 257 | nRow = (cnt+nCol-1)/nCol; |
| 258 | db_prepare(&q, "SELECT x, u FROM localfiles ORDER BY x /*scan*/"); |
| 259 | @ <table class="browser"><tr><td class="browser"><ul class="browser"> |
| 260 | i = 0; |
| 261 | while( db_step(&q)==SQLITE_ROW ){ |
| 262 |