On 4/29/05, François Steinmetz <francois.steinmetz@...400...> wrote:
I totally agree - and to control everything, you may choose the number of lines (horizontal) or columns (vertical) like in gimp.
I don't think even this is necessary. The algorithm might work like this:
- There's a minimum and a maximum swatch dimensions, Dmin and Dmax. (Perhaps the small/medium/large switch may remain, just choosing each their own Dmin and Dmax values.) I think Dmax should be about 5 times larger than Dmin.
- In horizontal mode:
1 The allocated vertical space is divided by Dmin. That's how many rows we have. The rows will have the height Dmin or slightly more (if there's a remainder in the division) so that the height fits exactly.
2 With this number of rows, swatches are flown into so many columns as necessary, with the width of Dmin. If they don't fit, horizontal scrollbar appears.
3 If the columns take _less_ width than the available horizontal space, they are stretched horizontally so as to fit exactly.
4 If the horizontal stretch makes them wider than Dmax, then the number of rows is reduced, the height is correspondingly increased, and they are reflown. The goal is to fill all horizontal space with the swatch width not exceeding Dmax.
- In vertical mode it's all the same, replacing rows by columns, width by height, and vice versa.
I think this will be the most natural behavior.
Jon, can you please implement it?