Handle different window sizes better, including rearranging the layout when in a vertical layout