WPrefs: use length of array instead of hard-coded constant for sample colours
commit74dc2d2cc01db5b3921e7c925d0097100808b921
authorChristophe CURIS <christophe.curis@free.fr>
Sun, 26 Oct 2014 18:58:49 +0000 (26 19:58 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 2 Nov 2014 12:13:20 +0000 (2 13:13 +0100)
treeea7ed11f06e00c524ef0c8f8101ee661bd57467e
parentefe0da4618f119d7556c1b48f92a1f6d025d1a79
WPrefs: use length of array instead of hard-coded constant for sample colours

In the panel for Appearance configuration, there are some sample colours
proposed to users; the code used to have a bunch of constants hard-coded
to handle these colours.

This patch replace all constants with the macro wlengthof to use the number
of element in the array determined by the compiler, so modifying the list
won't cause hidden bugs. This include a somehow smarter code to dispatch
the colours in the window to automatically arrange them cleanly whatever
their number is.

Took opportunity to de-CamelCase the name of the array as it did not add
complexity in the patch.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs.app/Appearance.c