resize layout when changing display