[REFACTORING] Moved resizing code to the window class.