Made the number of panels update as the window is resized.