Set preferred/minimum size

Now the initial size and resizing behave sanely.