added adaptivity when the window maximized.