Rewrite the settings window code.

It now resizes to fit all items.